8206004: [BACKOUT] errant changeset for JDK-8137164
authordcubed
Thu, 28 Jun 2018 10:46:05 -0400
changeset 50886 1b346a59b5da
parent 50881 a21cad3fa448
child 50887 fa91003ec489
8206004: [BACKOUT] errant changeset for JDK-8137164 Reviewed-by: dcubed, egahlin
src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java
src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java
src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java	Thu Jun 28 15:17:44 2018 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java	Thu Jun 28 10:46:05 2018 -0400
@@ -39,7 +39,6 @@
 
 import jdk.jfr.FlightRecorder;
 import jdk.jfr.Recording;
-import jdk.jfr.internal.JVM;
 import jdk.jfr.internal.SecuritySupport;
 import jdk.jfr.internal.SecuritySupport.SafePath;
 import jdk.jfr.internal.Utils;
@@ -66,17 +65,9 @@
         return result.toString();
     }
 
-    public String getPid() {
-        // Invoking ProcessHandle.current().pid() would require loading more
-        // classes during startup so instead JVM.getJVM().getPid() is used.
-        // The pid will not be exposed to running Java application, only when starting
-        // JFR from command line (-XX:StartFlightRecordin) or jcmd (JFR.start and JFR.check)
-        return JVM.getJVM().getPid();
-    }
-
     protected final SafePath resolvePath(Recording recording, String filename) throws InvalidPathException {
         if (filename == null) {
-            return makeGenerated(recording, Paths.get("."));
+             return makeGenerated(recording, Paths.get("."));
         }
         Path path = Paths.get(filename);
         if (Files.isDirectory(path)) {
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java	Thu Jun 28 15:17:44 2018 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java	Thu Jun 28 10:46:05 2018 -0400
@@ -80,7 +80,7 @@
         if (!verbose && recordings.isEmpty()) {
             println("No available recordings.");
             println();
-            println("Use jcmd " + getPid() + " JFR.start to start a recording.");
+            println("Use JFR.start to start a recording.");
             return;
         }
         boolean first = true;
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java	Thu Jun 28 15:17:44 2018 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java	Thu Jun 28 10:46:05 2018 -0400
@@ -220,13 +220,12 @@
             if (name != null) {
                 recordingspecifier = "name=" + quoteIfNeeded(name);
             }
-            print("Use jcmd " + getPid() + " JFR." + cmd + " " + recordingspecifier + " " + fileOption + "to copy recording data to file.");
+            print("Use JFR." + cmd + " " + recordingspecifier + " " + fileOption + "to copy recording data to file.");
             println();
         }
         return getResult();
     }
 
-
     // Instruments JDK-events on class load to reduce startup time
     private void initializeWithForcedInstrumentation(Map<String, String> settings) {
         if (!hasJDKEvents(settings)) {
--- a/test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java	Thu Jun 28 15:17:44 2018 +0200
+++ b/test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java	Thu Jun 28 10:46:05 2018 -0400
@@ -66,7 +66,7 @@
         // Use JFR.dump name=recording-1 filename=FILEPATH to copy recording data to file.
 
         String stdout = output.getStdout();
-        Pattern p = Pattern.compile(".*Use jcmd \\d+ JFR.dump name=(\\S+).*", Pattern.DOTALL);
+        Pattern p = Pattern.compile(".*Use JFR.dump name=(\\S+).*", Pattern.DOTALL);
         Matcher m = p.matcher(stdout);
         Asserts.assertTrue(m.matches(), "Could not parse recording name");
         String name = m.group(1);