--- old/src/share/classes/sun/tools/jstat/Arguments.java 2014-12-30 14:44:15.128059400 +0400 +++ new/src/share/classes/sun/tools/jstat/Arguments.java 2014-12-30 14:44:14.746615800 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -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) --- old/test/sun/tools/jstat/jstatHelp.sh 2014-12-30 14:44:17.095071700 +0400 +++ new/test/sun/tools/jstat/jstatHelp.sh 2014-12-30 14:44:16.652913300 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -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