From 30becccdaa558702286b5505b63f44028f19fa2a Mon Sep 17 00:00:00 2001 From: elrodro83 Date: Tue, 20 Aug 2024 16:54:40 -0300 Subject: [PATCH 1/2] W-16374984: Upgrade held back libraries because of dropped java 8 support --- .../java/org/mule/runtime/jpms/api/JpmsUtils.java | 13 +------------ modules/logging/src/main/java/module-info.java | 3 --- tests/runner/src/main/java/module-info.java | 1 - 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/modules/jpms-utils/src/main/java/org/mule/runtime/jpms/api/JpmsUtils.java b/modules/jpms-utils/src/main/java/org/mule/runtime/jpms/api/JpmsUtils.java index b9e11c66a6eb..3df52e27a1d1 100644 --- a/modules/jpms-utils/src/main/java/org/mule/runtime/jpms/api/JpmsUtils.java +++ b/modules/jpms-utils/src/main/java/org/mule/runtime/jpms/api/JpmsUtils.java @@ -154,18 +154,7 @@ static void doValidateArguments(List arguments) { public static void exploreJdkModules(Set packages) { boot().modules() .stream() - .filter(module -> { - final String moduleName = module.getName(); - - // Original intention is to only expose standard java modules... - return moduleName.startsWith("java.") - // TODO W-16374984: - // ... but because we need to keep compatibility with Java 8, older versions of some libraries use internal JDK - // modules packages: - // * caffeine 2.x still uses sun.misc.Unsafe. Ref: https://github.com/ben-manes/caffeine/issues/273 - // * obgenesis SunReflectionFactoryHelper, used by Mockito - || moduleName.startsWith("jdk."); - }) + .filter(module -> module.getName().startsWith("java.")) .forEach(module -> packages.addAll(module.getPackages())); } diff --git a/modules/logging/src/main/java/module-info.java b/modules/logging/src/main/java/module-info.java index cf084b351982..afd2b64fcc2f 100644 --- a/modules/logging/src/main/java/module-info.java +++ b/modules/logging/src/main/java/module-info.java @@ -12,9 +12,6 @@ */ module org.mule.runtime.logging { - // Allows usage of Unsafe for caffeine and disruptor libraries, used by the logging framework - requires jdk.unsupported; - // Logging framework requires org.slf4j; requires org.apache.logging.log4j; diff --git a/tests/runner/src/main/java/module-info.java b/tests/runner/src/main/java/module-info.java index 6cfd0fff5ea4..de51e29c77e6 100644 --- a/tests/runner/src/main/java/module-info.java +++ b/tests/runner/src/main/java/module-info.java @@ -31,7 +31,6 @@ requires org.mule.runtime.maven.client.impl; requires java.management; - requires jdk.management; requires com.google.common; requires org.apache.commons.codec; From 25d12cf627d9609010bd8c4e5ac782113beb9f7f Mon Sep 17 00:00:00 2001 From: Rodrigo Merino Date: Tue, 20 Aug 2024 17:27:43 -0300 Subject: [PATCH 2/2] jdk.management back --- tests/runner/src/main/java/module-info.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/runner/src/main/java/module-info.java b/tests/runner/src/main/java/module-info.java index de51e29c77e6..6cfd0fff5ea4 100644 --- a/tests/runner/src/main/java/module-info.java +++ b/tests/runner/src/main/java/module-info.java @@ -31,6 +31,7 @@ requires org.mule.runtime.maven.client.impl; requires java.management; + requires jdk.management; requires com.google.common; requires org.apache.commons.codec;