changeset 5540:b658cfe35857

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
author farvidsson
date Wed, 23 Oct 2013 10:24:28 +0200
parents c183576a2dd1
children b3a4d4279fa3 e64f1fe9756b
files test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java	Tue Oct 22 22:14:57 2013 -0400
+++ b/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()]);
     }