United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7149320 Move sun.misc.VM.booted() to end of System.initializeSystemClass()
7149320 : Move sun.misc.VM.booted() to end of System.initializeSystemClass()

Details
Type:
Enhancement
Submit Date:
2012-02-28
Status:
Closed
Updated Date:
2012-05-07
Project Name:
JDK
Resolved Date:
2012-05-07
Component:
core-libs
OS:
generic
Sub-Component:
java.lang
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
8
Fixed Versions:
8

Related Reports
Backport:
Relates:

Sub Tasks

Description
sun.misc.VM.booted() is currently called before setJavaLangAccess. For code which uses the JavaLangAccess shared secrets it's convenient to be able to check whether the secrets are initialized. In particluar with the static inner class holder idiom:

static class Holder {
  final sun.misc.JavaLangAccess ACCESS = sun.misc.SharedSecrets.getJavaLangAccess();
}

...

if(sun.misc.VM.isBooted() && Holder.ACCESS...

                                    

Comments
SUGGESTED FIX

http://hg.openjdk.java.net/jdk8/tl-gate/jdk/rev/971a86421f51
                                     
2012-03-01
SUGGESTED FIX

http://cr.openjdk.java.net/~mduigou/7149320/0/webrev/
                                     
2012-03-01
EVALUATION

move sun.misc.VM.booted() to the very end of the method.
                                     
2012-02-28



Hardware and Software, Engineered to Work Together