From 447de82fae687804529942bb88e734b58fcdb24f Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 15 Jun 2022 09:32:22 -0700 Subject: [PATCH] Recognize `-Djava.security.manager=allow` In the latest JDK versions, the string `allow` is not the name of a security manager, and instead indicates that the code is allowed to install a security manager of its own. PiperOrigin-RevId: 455150087 Change-Id: Iac26ec13ffd006fc3a758678e36c94dcc94beec4 --- .../com/google/testing/junit/runner/junit4/JUnit4Config.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java index 94c181bf2e67d6..21bd7855570bf3 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java @@ -86,7 +86,7 @@ private JUnit4Config( private static boolean installSecurityManager(Properties systemProperties) { String securityManager = systemProperties.getProperty("java.security.manager"); - if (securityManager != null) { + if (securityManager != null && !securityManager.equals("allow")) { return false; // Don't install over the specified security manager } return Boolean.valueOf(