-
Notifications
You must be signed in to change notification settings - Fork 42
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
Lookup bytebuddy strategy for JDK 17+ #646
base: master
Are you sure you want to change the base?
Conversation
Hey @m1c1b. Thanks for the PR and apologies for the delay in reviewing. Looking now. |
@m1c1b - why do we need both versions of |
@badgerwithagun I'm not sure that deleting anything is a good approach in backwards compatibility way. So let's leave an old |
I agree that if there are circumstances where the old approach will work but the new approach won't (for example, older JDKs) then it makes sense to keep both, but if that's the issue, then we should be as friendly as possible and simply auto-select the appropriate mechanism for the runtime by checking the On the other hand, if the new approach will always work, regardless of JDK, I would prefer to just keep the change small and switch to the new approach without retaining the old one. If we go for the first approach, I think the design of multiple proxy factor implementations seems needlessly heavily engineered; a simple |
So, should I check all versions below 17 for new approach? 16, 15, ... 8? Or just LTS releases: 11, 8? I think check using testcontainers can be a good way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @m1c1b, yes, just check the conditions and select the appropriate implementation. Maybe add a system property that allows the specific implementation to be forced if absolutely necessary, but default to making a sensible choice and don't change the API footprint.
Summary
This merge request introduces several enhancements and new features to the library, focusing on improving abstraction, readability, and compatibility with newer JDK versions.
Changes Made
AbstractProxyFactory Abstraction:
AbstractProxyFactory
to provide a more structured and reusable abstraction layer for proxy factories.LookupProxyFactory for JDK 17+:
ProxyFactory
namedLookupProxyFactory
.Lookup
ByteBuddy method for class loading, addressing the requirements for JDK 17 and above as per JEP 403.Builder Enhancement:
Improved Readability:
Static Imports and Refactoring:
Test Coverage:
ProxyFactory
tests for the newLookupProxyFactory
to ensure comprehensive test coverage.Documentation Note
I am currently uncertain whether to update the main documentation with these changes or to assume that developers will study the source code directly, given the highly technical nature of these updates. If it is deemed necessary to update the documentation to reflect these changes, I am more than willing to do so.