8203014: jcmd should output command list if no command is given
authorstuefe
Tue, 29 May 2018 20:57:42 +0200
changeset 50294 16be361f4320
parent 50293 edfb87b2520e
child 50295 84256425a4e9
8203014: jcmd should output command list if no command is given Reviewed-by: sspitsyn, simonis
src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java
--- a/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java	Tue May 29 11:20:04 2018 -0700
+++ b/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java	Tue May 29 20:57:42 2018 +0200
@@ -88,7 +88,9 @@
         }
 
         if (listCounters != true && sb.length() == 0) {
-            throw new IllegalArgumentException("No command specified");
+            // Omitting the command shall cause the target VM to print out a list
+            // of available commands.
+            sb.append("help");
         }
 
         command = sb.toString().trim();