From 23c5d806d4368cf4312269ce5d731c83facedbef Mon Sep 17 00:00:00 2001 From: Violeta Georgieva Date: Tue, 16 Jan 2024 12:58:53 +0200 Subject: [PATCH] Add reflection hints for io.netty.util.internal.PlatformDependent0 when JDK 21 Netty project has added a reflection specific for JDK 21 with https://github.com/netty/netty/pull/13366 The reflection hints need to be updated to cover also this JDK version. java.lang.NoSuchMethodException: java.nio.DirectByteBuffer.(long, long) at java.base@21.0.1/java.lang.Class.checkMethod(DynamicHub.java:1065) ~[spring.graalvm:na] at java.base@21.0.1/java.lang.Class.getConstructor0(DynamicHub.java:1228) ~[spring.graalvm:na] at java.base@21.0.1/java.lang.Class.getDeclaredConstructor(DynamicHub.java:2930) ~[spring.graalvm:na] at io.netty.util.internal.PlatformDependent0$5.run(PlatformDependent0.java:291) ~[na:na] at java.base@21.0.1/java.security.AccessController.executePrivileged(AccessController.java:129) ~[na:na] at java.base@21.0.1/java.security.AccessController.doPrivileged(AccessController.java:319) ~[na:na] at io.netty.util.internal.PlatformDependent0.(PlatformDependent0.java:286) ~[na:na] at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:331) ~[na:na] at io.netty.util.internal.PlatformDependent.(PlatformDependent.java:86) ~[na:na] --- .../4.1.80.Final/reflect-config.json | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json b/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json index 61474c6da..63f01aad9 100644 --- a/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json +++ b/metadata/io.netty/netty-common/4.1.80.Final/reflect-config.json @@ -3760,6 +3760,21 @@ } ] }, + { + "condition": { + "typeReachable": "io.netty.util.internal.PlatformDependent0" + }, + "name": "java.nio.DirectByteBuffer", + "methods": [ + { + "name": "", + "parameterTypes": [ + "long", + "long" + ] + } + ] + }, { "condition": { "typeReachable": "io.netty.util.internal.PlatformDependent0$5" @@ -3775,6 +3790,21 @@ } ] }, + { + "condition": { + "typeReachable": "io.netty.util.internal.PlatformDependent0$5" + }, + "name": "java.nio.DirectByteBuffer", + "queriedMethods": [ + { + "name": "", + "parameterTypes": [ + "long", + "long" + ] + } + ] + }, { "condition": { "typeReachable": "io.netty.channel.unix.Unix" @@ -4259,6 +4289,21 @@ } ] }, + { + "condition": { + "typeReachable": "io.netty.util.internal.PlatformDependent0$8" + }, + "name": "jdk.internal.misc.Unsafe", + "methods": [ + { + "name": "allocateUninitializedArray", + "parameterTypes": [ + "java.lang.Class", + "int" + ] + } + ] + }, { "condition": { "typeReachable": "io.netty.util.internal.logging.CommonsLoggerFactory"