7149320: Move sun.misc.VM.booted() to the end of System.initializeSystemClass()
authormduigou
Thu, 01 Mar 2012 09:40:18 -0800
changeset 12038 ba8cfc6c5118
parent 12037 11e6e438f738
child 12039 fe21bbf8f775
7149320: Move sun.misc.VM.booted() to the end of System.initializeSystemClass() Summary: Ensure that sun.misc.VM.booted() is the last action in System.initSystemClass() Reviewed-by: dholmes, alanb
jdk/src/share/classes/java/lang/System.java
--- a/jdk/src/share/classes/java/lang/System.java	Thu Mar 01 14:02:44 2012 +0100
+++ b/jdk/src/share/classes/java/lang/System.java	Thu Mar 01 09:40:18 2012 -0800
@@ -1168,11 +1168,6 @@
         // classes are used.
         sun.misc.VM.initializeOSEnvironment();
 
-        // Subsystems that are invoked during initialization can invoke
-        // sun.misc.VM.isBooted() in order to avoid doing things that should
-        // wait until the application class loader has been set up.
-        sun.misc.VM.booted();
-
         // The main thread is not added to its thread group in the same
         // way as other threads; we must do it ourselves here.
         Thread current = Thread.currentThread();
@@ -1180,6 +1175,12 @@
 
         // register shared secrets
         setJavaLangAccess();
+
+        // Subsystems that are invoked during initialization can invoke
+        // sun.misc.VM.isBooted() in order to avoid doing things that should
+        // wait until the application class loader has been set up.
+        // IMPORTANT: Ensure that this remains the last initialization action!
+        sun.misc.VM.booted();
     }
 
     private static void setJavaLangAccess() {