commit | 447de82fae687804529942bb88e734b58fcdb24f | [log] [tgz] |
---|---|---|
author | Googler <cushon@google.com> | Wed Jun 15 09:32:22 2022 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Jun 15 09:33:23 2022 -0700 |
tree | 86909a21f9eee80d0c90bf082b217f5eafd8ddfe | |
parent | 8b816f5a665689b96ce7ca3dcbaf1d38da38ce8e [diff] |
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
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 94c181b..21bd785 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 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(