changeset 50878:16be361f4320

8203014: jcmd should output command list if no command is given Reviewed-by: sspitsyn, simonis
author stuefe
date Tue, 29 May 2018 20:57:42 +0200
parents edfb87b2520e
children 84256425a4e9
files src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();