Review request for 6810254

Alan Bateman Alan.Bateman at Sun.COM
Fri Mar 6 15:21:44 UTC 2009

Mandy Chung wrote:
> 6810254: Lazily instantiate the shared secret access objects
> Webrev at:
> sun.misc.Java*Access objects are created at initialization time.  
> However, they are not always needed.  They can be instantiated lazily 
> when needed.  The fix is to add a static setSharedSecret() method to 
> be called by sun.misc.SharedSecrets via reflection when the shared 
> secret access object is requested.
> Thanks
> Mandy
It's good to see the setup of the shutdown hooks being removed from the 
initialization. However, I think it might be cleaner have each register 
itself lazily rather than SharedSecrets knowing about it. That has the 
added benefit that only the needed hooks are registered. It also avoids 
needing the reflection code. A possible downside is that each hook needs 
to know its place in the world. Attached is a (completely unpolished) 
patch that does this and perhaps it would be useful to try.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shutdown.patch
Type: text/x-patch
Size: 11568 bytes
Desc: not available
URL: <>

More information about the core-libs-dev mailing list