7149320: Move sun.misc.VM.booted() to the end of System.initializeSystemClass()
Ensure that sun.misc.VM.booted() is the last action in System.initSystemClass()
Reviewed-by: dholmes, alanb
diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java
index e4adf8d..2eaaf39 100644
--- a/jdk/src/share/classes/java/lang/System.java
+++ b/jdk/src/share/classes/java/lang/System.java
@@ -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() {