7122342: testPrintProcessorInfo/TestWithXstdout.java failed for JDK8 nightly build at 12/16/2011
Summary: Do not pass empty args to javac
Reviewed-by: jjg
--- a/langtools/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java Fri Dec 16 13:49:44 2011 -0800
+++ b/langtools/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java Fri Dec 16 16:41:00 2011 -0800
@@ -58,11 +58,14 @@
if (javaHome.getName().equals("jre"))
javaHome = javaHome.getParentFile();
File javac = new File(new File(javaHome, "bin"), "javac");
- String toolOpts = System.getProperty("test.tool.vm.opts");
List<String> opts = new ArrayList<>();
opts.add(javac.getPath());
- opts.addAll(Arrays.asList(toolOpts.trim().split("[\\s]+")));
+
+ String toolOpts = System.getProperty("test.tool.vm.opts");
+ if (toolOpts != null && !"".equals(toolOpts.trim())) {
+ opts.addAll(Arrays.asList(toolOpts.trim().split("[\\s]+")));
+ }
opts.addAll(Arrays.asList(args));
System.out.println("exec: " + opts);
ProcessBuilder pb = new ProcessBuilder(opts);