Merge
authordbuck
Mon, 21 Dec 2015 23:00:15 +0100
changeset 34779 b48aefdd9a34
parent 34775 311773a49782 (diff)
parent 34778 45c1293ab19a (current diff)
child 34780 e4e98944903e
Merge
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java	Mon Dec 21 21:14:19 2015 +0100
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java	Mon Dec 21 23:00:15 2015 +0100
@@ -49,7 +49,7 @@
 
 /*
  * @test
- * @bug 8077350 8081566 8081567 8098852
+ * @bug 8077350 8081566 8081567 8098852 8136597
  * @build jdk.testlibrary.*
  * @library /lib/testlibrary
  * @summary Functions of ProcessHandle.Info
@@ -210,10 +210,12 @@
                             Assert.assertTrue(commandLine.contains(allArgs.get(i)),
                                               "commandLine() must contain argument: " + allArgs.get(i));
                         }
-                    } else if (info.commandLine().isPresent()) {
+                    } else if (info.commandLine().isPresent() &&
+                            command.isPresent() &&
+                            command.get().length() < info.commandLine().get().length()) {
                         // If we only have the commandLine() we can only do some basic checks...
                         String commandLine = info.commandLine().get();
-                        String javaExe = "java" + (Platform.isWindows() ? ".exe": "");
+                        String javaExe = "java" + (Platform.isWindows() ? ".exe" : "");
                         int pos = commandLine.indexOf(javaExe);
                         Assert.assertTrue(pos > 0, "commandLine() should at least contain 'java'");