United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6810254 Lazily instantiate the shared secret access objects
6810254 : Lazily instantiate the shared secret access objects

Details
Type:
Bug
Submit Date:
2009-02-25
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-03-27
Component:
other-libs
OS:
generic
Sub-Component:
other
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description
sun.misc.Java*Access objects are created at initialization time.  They are only needed when certain API is used.  They can be initialized lazily when needed.

These shared secret access object provides a mechanism for calling implementation-private methods in another package while avoiding the primary disadvantage of using reflection for this purpose, namely the loss of compile-time checking.

                                    

Comments
SUGGESTED FIX

See attached patch.
                                     
2009-03-13
EVALUATION

The fix is to register the shutdown hooks only when needed so that java.io.Console and other implementation classes for deleteOnExit hooks and application hooks are not loaded unless they are needed.

JavaIODeleteOnExitAccess will be removed and the other shared secret access objects will remain to be set up during initialization.
                                     
2009-03-12
EVALUATION

Decouple class dependency for JDK7
                                     
2009-02-26



Hardware and Software, Engineered to Work Together