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
--- 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()]);
}