8026808: serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java failed with unexpected exit value
authorfarvidsson
Wed, 23 Oct 2013 10:24:28 +0200
changeset 21083 45b520adf92d
parent 21082 a4ce9825eb1c
child 21084 31bdb14868f6
child 21183 e148e499e5cd
8026808: serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java failed with unexpected exit value Summary: Fixes a bug with vmArgs when using JDKToolLauncher Reviewed-by: sla, dholmes
hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java	Tue Oct 22 22:14:57 2013 -0400
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java	Wed Oct 23 10:24:28 2013 +0200
@@ -100,7 +100,7 @@
      * @return The JDKToolLauncher instance
      */
     public JDKToolLauncher addVMArg(String arg) {
-        vmArgs.add("-J" + arg);
+        vmArgs.add(arg);
         return this;
     }
 
@@ -124,7 +124,10 @@
     public String[] getCommand() {
         List<String> command = new ArrayList<String>();
         command.add(executable);
-        command.addAll(vmArgs);
+        // Add -J in front of all vmArgs
+        for (String arg : vmArgs) {
+            command.add("-J" + arg);
+        }
         command.addAll(toolArgs);
         return command.toArray(new String[command.size()]);
     }