changeset 4982:8004f3dd5c54

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
author mduigou
date Fri, 11 May 2012 10:46:51 -0700
parents 96bbb23bbaca
children 0128a8d8c0b4
files src/share/classes/java/lang/System.java
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/System.java	Fri May 11 11:52:04 2012 +0100
+++ b/src/share/classes/java/lang/System.java	Fri May 11 10:46:51 2012 -0700
@@ -1153,11 +1153,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();
@@ -1165,6 +1160,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() {