From 3c0d4c78042cbc267376459e65234872d1c1eb04 Mon Sep 17 00:00:00 2001 From: farvidsson Date: Wed, 23 Oct 2013 10:24:28 +0200 Subject: [PATCH] 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 --- .../com/oracle/java/testlibrary/JDKToolLauncher.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java b/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java index 7871bd2ce..4534a8fe2 100644 --- a/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java +++ b/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java @@ -100,7 +100,7 @@ public class JDKToolLauncher { * @return The JDKToolLauncher instance */ public JDKToolLauncher addVMArg(String arg) { - vmArgs.add("-J" + arg); + vmArgs.add(arg); return this; } @@ -124,7 +124,10 @@ public class JDKToolLauncher { public String[] getCommand() { List command = new ArrayList(); 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()]); } -- GitLab