From 87dff9323396af26cd518e3d995981417fe2411a Mon Sep 17 00:00:00 2001 From: Dmytro Vyazelenko <696855+vyazelenko@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:25:54 +0100 Subject: [PATCH] [Java] Add missing `--add-opens`. --- .../cluster/ClusterNetworkTopologyTest.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterNetworkTopologyTest.java b/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterNetworkTopologyTest.java index 53311aebae..4433ca5546 100644 --- a/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterNetworkTopologyTest.java +++ b/aeron-system-tests/src/test/java/io/aeron/cluster/ClusterNetworkTopologyTest.java @@ -40,7 +40,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; -import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.RegisterExtension; @@ -63,7 +62,6 @@ import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; -import java.util.EnumSet; import java.util.List; import java.util.Set; import java.util.regex.Pattern; @@ -461,12 +459,10 @@ private String[] deriveCommand( IoUtil.delete(clusterDir, false); IoUtil.ensureDirectoryExists(clusterDir, "cluster base directory"); - if (isVersionAfterJdk8()) - { - command.add("--add-opens"); - command.add("java.base/sun.nio.ch=ALL-UNNAMED"); - } - + command.add("--add-opens"); + command.add("java.base/jdk.internal.misc=ALL-UNNAMED"); + command.add("--add-opens"); + command.add("java.base/java.util.zip=ALL-UNNAMED"); command.add("-Xmx32m"); command.add("-cp"); command.add(FileResolveUtil.resolveAeronAllJar().getAbsolutePath()); @@ -501,9 +497,4 @@ private String[] deriveCommand( return command.toArray(new String[0]); } - - private static boolean isVersionAfterJdk8() - { - return EnumSet.range(JRE.JAVA_9, JRE.OTHER).contains(JRE.currentVersion()); - } }