[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR(XS) 6364329 jstat displays "invalid argument count" with usage
From:       Jaroslav Bachorik <jaroslav.bachorik () oracle ! com>
Date:       2014-11-30 16:52:27
Message-ID: 547B4B4B.6020303 () oracle ! com
[Download RAW message or body]

On 11/28/2014 06:50 PM, Erik Gahlin wrote:
> Looks good, and works on all platforms I have tried it with.
>
> I have put up your changeset for review here:
> http://cr.openjdk.java.net/~egahlin/6364329_0/
>
> As soon as I get Reviewer approval,  I will update with reviewers name
> and push your change.

Thumbs up! (just update the copyright years before push)

-JB-

>
> Thanks for contributing!
>
> Erik
>
> Yuri Gaevsky skrev 2014-11-28 12:33:
>> Thanks for the clarifications, Erik.
>>
>> Please see below the updated patch for JDK-6364329:
>>
>> --- start ---
>> $ 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)
>> diff --git a/test/sun/tools/jstat/jstatHelp.sh
>> b/test/sun/tools/jstat/jstatHelp.sh
>> --- a/test/sun/tools/jstat/jstatHelp.sh
>> +++ b/test/sun/tools/jstat/jstatHelp.sh
>> @@ -22,9 +22,9 @@
>>   #
>>   # @test
>> -# @bug 4990825
>> +# @bug 4990825 6364329
>>   # @run shell jstatHelp.sh
>> -# @summary Test that output of 'jstat -?' matches the usage.out file
>> +# @summary Test that output of 'jstat -?', 'jstat -help' and 'jstat'
>> matches the usage.out file
>>   . ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
>> @@ -38,7 +38,7 @@
>>   diff -w jstat.out ${TESTSRC}/usage.out
>>   if [ $? != 0 ]
>>   then
>> -  echo "Output of jstat -? differ from expected output. Failed."
>> +  echo "Output of jstat -? differs from expected output. Failed."
>>     exit 1
>>   fi
>> @@ -48,7 +48,17 @@
>>   diff -w jstat.out ${TESTSRC}/usage.out
>>   if [ $? != 0 ]
>>   then
>> -  echo "Output of jstat -help differ from expected output. Failed."
>> +  echo "Output of jstat -help differs from expected output. Failed."
>> +  exit 1
>> +fi
>> +
>> +rm -f jstat.out 2>/dev/null
>> +${JSTAT} -J-XX:+UsePerfData > jstat.out 2>&1
>> +
>> +diff -w jstat.out ${TESTSRC}/usage.out
>> +if [ $? != 0 ]
>> +then
>> +  echo "Output of jstat differs from expected output. Failed."
>>     exit 1
>>   fi
>> --- end ---
>>
>> Best regards,
>> -Yuri
>>
>> -----Original Message-----
>> From: Erik Gahlin [mailto:erik.gahlin@oracle.com]
>> Sent: Friday, November 28, 2014 12:00 AM
>> To: Yuri Gaevsky
>> Cc: serviceability-dev@openjdk.java.net
>> Subject: Re: RFR(XS) 6364329 jstat displays "invalid argument count"
>> with usage
>>
>> First make sure your change doesn't break existing jtreg tests, the ones
>> in jdk/test/sun/tools/jstat.
>>
>> If everything is fine, you could add output verification to
>> jstatHelp.sh, similar to what exists today for -? and -help.
>>
>> Thanks
>> Erik
>>
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic