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

Update unsafe class defining to work on Java 17+ #1529

Closed
wants to merge 2 commits into from

Conversation

mcculls
Copy link
Contributor

@mcculls mcculls commented Jul 14, 2021

Java 17 has removed Unsafe.defineAnonymousClass in favour of Lookup.defineHiddenClass

@google-cla google-cla bot added the cla: yes label Jul 14, 2021
Copy link
Member

@sameb sameb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mcculls! In addition to the comment, would it be possible to add some kind of package-level description of the flow this code takes? It's somewhat hard to follow today already, and the additional ClassDefiner impls makes it even harder. Some kind of README.md or comments in an entry-point class that describe how the classes work together and when we fallback from A->B->C, etc.. would be helpful in explaining this.

Thanks!

core/test/com/google/inject/MethodInterceptionTest.java Outdated Show resolved Hide resolved
@jaroslawr jaroslawr mentioned this pull request Sep 17, 2021
copybara-service bot pushed a commit that referenced this pull request Sep 27, 2021
Java 17 has removed Unsafe.defineAnonymousClass in favor of Lookup.defineHiddenClass

PiperOrigin-RevId: 398348318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants