Browse Source

Revert "Pass -Djava.security.manager=allow while launching JUnit forked VM to allow JUnit triggered code to set security manager at runtime"

This reverts commit 13e6e30958.
master
Jaikiran Pai 3 years ago
parent
commit
5086264e00
1 changed files with 0 additions and 10 deletions
  1. +0
    -10
      src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

+ 0
- 10
src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java View File

@@ -64,7 +64,6 @@ import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Permissions;
import org.apache.tools.ant.types.PropertySet;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.util.LoaderUtils;
import org.apache.tools.ant.util.SplitClassLoader;
import org.apache.tools.ant.util.StringUtils;
@@ -1165,15 +1164,6 @@ public class JUnitTask extends Task {
} catch (final CloneNotSupportedException e) {
throw new BuildException("This shouldn't happen", e, getLocation());
}
// if Java 18, then we set -Djava.security.manager=allow so as to allow
// Ant code to internally set the security manager
if (JavaEnvUtils.isAtLeastJavaVersion("18")) {
log("Setting -Djava.security.manager=allow on forked JVM of JUnit task", Project.MSG_VERBOSE);
final Environment.Variable securityManagerSysProp = new Environment.Variable();
securityManagerSysProp.setKey("java.security.manager");
securityManagerSysProp.setValue("allow");
cmd.addSysproperty(securityManagerSysProp);
}
if (casesFile == null) {
cmd.createArgument().setValue(test.getName());
if (test.getMethods() != null) {


Loading…
Cancel
Save