Review request for 6810254

Mandy Chung Mandy.Chung at Sun.COM
Fri Mar 6 18:44:33 UTC 2009

Thanks Alan.  This is a good approach that avoids using reflection and 
addresses David's concern.  I was a bit aggressive to lazily instantiate 
Java*Access objects as many as I can.  I'll revise the fix and send out 
a new webrev.


Alan Bateman wrote:
> 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.
> -Alan.

More information about the core-libs-dev mailing list