8076486: [TESTBUG] javax/security/auth/Subject/doAs/NestedActions.java fails if extra VM options are given
authorasmotrak
Wed, 06 May 2015 09:22:03 +0800
changeset 30372 83ebb3d73b77
parent 30371 aa862dad6ad9
child 30373 7b7094f0b833
8076486: [TESTBUG] javax/security/auth/Subject/doAs/NestedActions.java fails if extra VM options are given Reviewed-by: weijun
jdk/test/javax/security/auth/Subject/doAs/NestedActions.java
--- a/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java	Tue May 05 18:18:06 2015 -0700
+++ b/jdk/test/javax/security/auth/Subject/doAs/NestedActions.java	Wed May 06 09:22:03 2015 +0800
@@ -34,6 +34,7 @@
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
@@ -144,7 +145,7 @@
         }
         cmds.add(sb.toString());
         if (JAVA_OPTS != null && !JAVA_OPTS.isEmpty()) {
-            cmds.add(JAVA_OPTS);
+            Collections.addAll(cmds, JAVA_OPTS.trim().split("\\s+"));
         }
         cmds.add("-Djava.security.manager");
         cmds.add("-Djava.security.policy=" + TEST_SOURCES + FS + args[1]);