RFR(XS) 6364329 jstat displays "invalid argument count" with usage
Erik Gahlin
erik.gahlin at oracle.com
Thu Nov 27 15:29:11 UTC 2014
Hi Yuri,
Not sure what the correct behavior is. This is what I get:
jinfo - prints help
jhat - prints "ERROR: No arguments supplied" + help
jstack -prints help
jstatd -prints "Could not create remote object" and a security exception
jstat - prints "invalid argument count" + help
jmap - prints help
I'm not a reviewer, but I can sponsor your patch if it is accepted. If
so, could you update the test as well.
Thanks
Erik
Yuri Gaevsky skrev 2014-11-26 16:08:
> ping...
>
> -----Original Message-----
> From: serviceability-dev [mailto:serviceability-dev-bounces at openjdk.java.net] On Behalf Of Yuri Gaevsky
> Sent: Thursday, November 20, 2014 1:11 AM
> To: serviceability-dev at openjdk.java.net
> Subject: RFR(XS) 6364329 jstat displays "invalid argument count" with usage
>
> Hello.
>
> Please see below a small fix for integration into JDK 9:
>
> $ hg diff
> diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java
> --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java
> +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java
> @@ -141,8 +141,9 @@
> public Arguments(String[] args) throws IllegalArgumentException {
> int argc = 0;
>
> - if (args.length < 1) {
> - throw new IllegalArgumentException("invalid argument count");
> + if (args.length == 0) {
> + help = true;
> + return;
> }
>
> if ((args[0].compareTo("-?") == 0)
>
>
> Thanks,
> -Yuri
>
More information about the serviceability-dev
mailing list