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

Add reflection hints for io.netty.util.internal.PlatformDependent0 when JDK 21 #434

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

violetagg
Copy link
Contributor

What does this PR do?

Netty project has added a reflection specific for JDK 21 with netty/netty#13366
The reflection hints need to be updated to cover also this JDK version.

The exception below is observed in the logs when running without these hints:

java.lang.NoSuchMethodException: java.nio.DirectByteBuffer.<init>(long, long)
        at [email protected]/java.lang.Class.checkMethod(DynamicHub.java:1065) ~[spring.graalvm:na]
        at [email protected]/java.lang.Class.getConstructor0(DynamicHub.java:1228) ~[spring.graalvm:na]
        at [email protected]/java.lang.Class.getDeclaredConstructor(DynamicHub.java:2930) ~[spring.graalvm:na]
        at io.netty.util.internal.PlatformDependent0$5.run(PlatformDependent0.java:291) ~[na:na]
        at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:129) ~[na:na]
        at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:319) ~[na:na]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:286) ~[na:na]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:331) ~[na:na]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:86) ~[na:na]

Code sections where the PR accesses files, network, docker or some external service

  • N/A

Checklist before merging

Test is not provided because the current Gradle version that the project uses does not support JDK21.

…en JDK 21

Netty project has added a reflection specific for JDK 21 with netty/netty#13366
The reflection hints need to be updated to cover also this JDK version.

java.lang.NoSuchMethodException: java.nio.DirectByteBuffer.<init>(long, long)
        at [email protected]/java.lang.Class.checkMethod(DynamicHub.java:1065) ~[spring.graalvm:na]
        at [email protected]/java.lang.Class.getConstructor0(DynamicHub.java:1228) ~[spring.graalvm:na]
        at [email protected]/java.lang.Class.getDeclaredConstructor(DynamicHub.java:2930) ~[spring.graalvm:na]
        at io.netty.util.internal.PlatformDependent0$5.run(PlatformDependent0.java:291) ~[na:na]
        at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:129) ~[na:na]
        at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:319) ~[na:na]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:286) ~[na:na]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:331) ~[na:na]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:86) ~[na:na]
@violetagg violetagg requested a review from a team as a code owner January 16, 2024 11:08
@violetagg violetagg requested a review from melix January 16, 2024 11:08
@violetagg
Copy link
Contributor Author

cc @bclozel @sdeleuze

Copy link
Collaborator

@sdeleuze sdeleuze left a comment

Choose a reason for hiding this comment

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

Looks good to me.
@dnestoro Please merge it.

@dnestoro dnestoro merged commit 9f159ca into oracle:master Jan 18, 2024
6 checks passed
@violetagg
Copy link
Contributor Author

@sdeleuze @dnestoro Thanks!

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

Successfully merging this pull request may close these issues.

3 participants