Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please avoid the hacks used to get private Lookup objects in LookupFactory #277

Open
sundararajana opened this issue Jan 3, 2025 · 1 comment

Comments

@sundararajana
Copy link

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.

@sundararajana 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@sundararajana and others