You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of trying to get Lookup using hacks (sun.misc.Unsafe and deep-reflection on MethodHandles.Lookup), Parboiled API could be adjusted to receive (private) Lookup of Parser class as an API argument.
You do check for a public static method that returns Lookup and then fall back to Unsafe/deep-reflection hack. But, returning private Lookup via public method is a bad idea - basically, opens the class for any caller that can access the parser class! Parboiled API can require Lookup object be passed as an argument from a public API and cache it in LookupFactory.
The text was updated successfully, but these errors were encountered:
sundararajana
changed the title
please avoid the hack used to get private Lookup objects in LookupFactory
Please avoid the hacks used to get private Lookup objects in LookupFactory
Jan 3, 2025
Instead of trying to get Lookup using hacks (sun.misc.Unsafe and deep-reflection on MethodHandles.Lookup), Parboiled API could be adjusted to receive (private) Lookup of Parser class as an API argument.
You do check for a public static method that returns Lookup and then fall back to Unsafe/deep-reflection hack. But, returning private Lookup via public method is a bad idea - basically, opens the class for any caller that can access the parser class! Parboiled API can require Lookup object be passed as an argument from a public API and cache it in LookupFactory.
The text was updated successfully, but these errors were encountered: