Need reviewer for 6902010: (cl) Delay initialization of ClassLoader.parallelLoaders

Alan Bateman Alan.Bateman at Sun.COM
Tue Nov 17 18:04:00 UTC 2009


I'd like to re-visit the initialization of the parallel-capable loaders 
[1]. Currently the set of parallel-capable loader types is created by 
ClassLoader's initializer. That works today but is a bit fragile in that 
any changes or fixes that cause ClassLoader to be initialized earlier in 
the VM startup could cause problems. For example, if ClassLoader were to 
be initialized earlier then adding the initial element will cause a weak 
reference to be created and that will NPE in the Reference's initializer 
as the main thread isn't in a thread group at that point. All code that 
executes before the system classes are fully initialized requires great 
care so for this one, I think the simplest thing would be to delay the 
initialization unless the first loader is created. Does that seem 
reasonable? I've put a webrev with the proposed changes here:
For testing, I've been using the tests in 



More information about the core-libs-dev mailing list