--- 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