8037225: sun/tools/jinfo/Basic.sh fails
authorsla
Fri, 21 Mar 2014 14:45:54 +0100
changeset 23567 3d38400b44a2
parent 23566 760a74c1b589
child 23568 c92e1347bcac
8037225: sun/tools/jinfo/Basic.sh fails Reviewed-by: alanb
jdk/src/share/classes/sun/tools/jinfo/JInfo.java
jdk/test/sun/tools/jinfo/Basic.sh
--- a/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Fri Mar 21 09:38:04 2014 +0100
+++ b/jdk/src/share/classes/sun/tools/jinfo/JInfo.java	Fri Mar 21 14:45:54 2014 +0100
@@ -78,8 +78,16 @@
         }
 
         if (useSA) {
+            // SA only supports -flags or -sysprops
+            if (args[0].startsWith("-")) {
+                if (!(args[0].equals("-flags") || args[0].equals("-sysprops"))) {
+                    usage(1);
+                }
+            }
+
             // invoke SA which does it's own argument parsing
             runTool(args);
+
         } else {
             // Now we can parse arguments for the non-SA case
             String pid = null;
--- a/jdk/test/sun/tools/jinfo/Basic.sh	Fri Mar 21 09:38:04 2014 +0100
+++ b/jdk/test/sun/tools/jinfo/Basic.sh	Fri Mar 21 14:45:54 2014 +0100
@@ -40,6 +40,7 @@
 
 # all return statuses are checked in this test
 set +e
+set -x
 
 failed=0
 
@@ -71,16 +72,6 @@
     # no option
     ${JINFO} -J-XX:+UsePerfData -F $appJavaPid
     if [ $? != 0 ]; then failed=1; fi
-
-    # -flag option
-    ${JINFO} -J-XX:+UsePerfData -F -flag +PrintGC $appJavaPid
-    if [ $? != 0 ]; then failed=1; fi 
-
-    ${JINFO} -J-XX:+UsePerfData -F -flag -PrintGC $appJavaPid
-    if [ $? != 0 ]; then failed=1; fi
-
-    ${JINFO} -J-XX:+UsePerfData -F -flag PrintGC $appJavaPid
-    if [ $? != 0 ]; then failed=1; fi
 fi
 
 # -sysprops option