8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
authorjmanson
Fri, 17 Jul 2015 10:48:57 -0700
changeset 31904 52cbdafe3e40
parent 31813 977744526c8d
child 31905 5e98d236fdaa
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS Summary: Ensures special-cased command line options are settable via _JAVA_OPTIONS and JAVA_TOOL_OPTIONS. Reviewed-by: coleenp, ddmitriev
jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Wed Jul 15 13:21:25 2015 +0200
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Fri Jul 17 10:48:57 2015 -0700
@@ -63,13 +63,18 @@
                 createJavaProcessBuilder(
                     "-XX:+UseConcMarkSweepGC",  // this will cause UseParNewGC to be FLAG_SET_ERGO
                     "-XX:+PrintGCDetails",
+                    "-XX:+UseCerealGC",         // Should be ignored.
                     "-XX:Flags=" + flagsFile.getAbsolutePath(),
                     "-cp", System.getProperty("test.class.path"),
                     "CheckOrigin",
                     "-runtests");
 
             Map<String, String> env = pb.environment();
-            env.put("_JAVA_OPTIONS", "-XX:+PrintOopAddress");
+            // "UseCMSGC" should be ignored.
+            env.put("_JAVA_OPTIONS", "-XX:+TraceExceptions -XX:+UseCMSGC");
+            // "UseGOneGC" should be ignored.
+            env.put("JAVA_TOOL_OPTIONS", "-XX:+IgnoreUnrecognizedVMOptions "
+                + "-XX:+PrintVMOptions -XX:+UseGOneGC");
 
             pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
             pb.redirectError(ProcessBuilder.Redirect.INHERIT);
@@ -94,7 +99,10 @@
             // Set on the command line
             checkOrigin("PrintGCDetails", Origin.VM_CREATION);
             // Set in _JAVA_OPTIONS
-            checkOrigin("PrintOopAddress", Origin.ENVIRON_VAR);
+            checkOrigin("TraceExceptions", Origin.ENVIRON_VAR);
+            // Set in JAVA_TOOL_OPTIONS
+            checkOrigin("IgnoreUnrecognizedVMOptions", Origin.ENVIRON_VAR);
+            checkOrigin("PrintVMOptions", Origin.ENVIRON_VAR);
             // Set in -XX:Flags file
             checkOrigin("PrintSafepointStatistics", Origin.CONFIG_FILE);
             // Set through j.l.m