From 49dcd17ea29079c9d3e58ba4455ccca7a1cd9a2e Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Fri, 12 Apr 2024 09:10:59 +0200 Subject: [PATCH 1/2] svm: adopt "JDK-8328366: Thread.setContextClassloader from thread in FJP commonPool task no longer works after JDK-8327501" (cherry picked from commit 10bb0c6797753cd21ceef3bd2228f66dc73969e0) --- .../src/com/oracle/svm/core/jdk/RecomputedFields.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecomputedFields.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecomputedFields.java index f587cd7aad1..c4e0c88ac1d 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecomputedFields.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecomputedFields.java @@ -33,6 +33,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.nio.charset.CharsetDecoder; +import java.security.AccessControlContext; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ForkJoinPool; @@ -386,6 +387,15 @@ private static synchronized ForkJoinPool initializeCommonPool() { } } +@TargetClass(value = java.util.concurrent.ForkJoinPool.class, innerClass = "DefaultForkJoinWorkerThreadFactory", onlyWith = JDK21OrLater.class) +@SuppressWarnings("removal") +final class Target_java_util_concurrent_ForkJoinPool_DefaultForkJoinWorkerThreadFactory { + @Alias @RecomputeFieldValue(kind = Reset) // + static AccessControlContext regularACC; + @Alias @RecomputeFieldValue(kind = Reset) // + static AccessControlContext commonACC; +} + /** Dummy class to have a class with the file's name. */ public final class RecomputedFields { } From dab7d02e67351339277a69ac325faff8da02fe88 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 20 Aug 2024 21:58:20 +0300 Subject: [PATCH 2/2] Fix style issues Style issues introduced by https://github.com/graalvm/graalvm-community-jdk21u/pull/4 --- .../src/com/oracle/svm/core/jdk/JDK21u3OrEarlier.java | 2 +- .../src/com/oracle/svm/core/jdk/JDK21u4OrLater.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u3OrEarlier.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u3OrEarlier.java index 9c8a0124255..a4275782a0b 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u3OrEarlier.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u3OrEarlier.java @@ -31,7 +31,7 @@ public class JDK21u3OrEarlier implements BooleanSupplier { public static final boolean jdk21u3OrEarlier = JavaVersionUtil.JAVA_SPEC < 21 || - (JavaVersionUtil.JAVA_SPEC == 21 && Runtime.version().update() <= 3); + (JavaVersionUtil.JAVA_SPEC == 21 && Runtime.version().update() <= 3); @Override public boolean getAsBoolean() { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u4OrLater.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u4OrLater.java index c39b8758dc1..f8e0115bd9a 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u4OrLater.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JDK21u4OrLater.java @@ -31,7 +31,7 @@ public class JDK21u4OrLater implements BooleanSupplier { public static final boolean jdk21u4OrLater = JavaVersionUtil.JAVA_SPEC > 21 || - (JavaVersionUtil.JAVA_SPEC == 21 && Runtime.version().update() >= 4); + (JavaVersionUtil.JAVA_SPEC == 21 && Runtime.version().update() >= 4); @Override public boolean getAsBoolean() {