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

AccessClassLoader delegates to parent loader for not-yet-generated classes #52

Closed
nqzero opened this issue Nov 30, 2016 · 0 comments
Closed

Comments

@nqzero
Copy link

nqzero commented Nov 30, 2016

the {Constructor,Field,Method}Access classes first delegate to AccessClassLoader when an accessor is requested and the ACL in turn delegates to the parent classloader, and generates the accessor if it is not found. ie, it uses the parent class loader as a cache

this can be an expensive operation, eg if the parent classloader is a network loader, and as such is not a very good cache

i submitted a pull request (#51) that works around this by only querying the parent class loader if the accessor has been generated, but it hasn't been commented on or accepted

an alternative would be to identify the accessor classes in the parent classloader and throw an exception there (rather than query the network). however, i don't see a reasonably safe means of identifying generated class names (the naming scheme involves appending "{Constructor,Field,Method}Access" which could well show up in a user class name). i'd be willing to submit a pull request that used more-easily-filtered names if that approach would be preferred (eg EsotericSoftwareOriginalNameFieldAccess), though i prefer the former deterministic approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant