RFR: 8236075: Minor bootstrap improvements

Alan Bateman Alan.Bateman at oracle.com
Mon Jan 20 20:46:09 UTC 2020


On 20/01/2020 15:54, Claes Redestad wrote:
> Hi,
>
> some minor cleanups and enhancements in and around java.lang.ClassLoader
> which add up to a small startup improvement:
>
> - Remove use of Vector/Hashtable from ClassLoader, along with a few
>   other improvements/modernizations.
> - Refactor ClassLoader::sys_paths/user_paths so that they're initialized
> lazily but also published safely
>
> Webrev: http://cr.openjdk.java.net/~redestad/8236075/open.01/
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8236075
>
I went through the changes too and they mostly look good to me. I have 
the same reaction to Mandy about the duplication of parsePath in the 
unix and macos versions of ClassLoaderHelper. The outlier is 
mapAlternativeName and maybe that might move elsewhere in time but I 
think what you have is okay.

For userPath/sysPath then I think those methods were okay when they were 
in ClassLoader (and close to their usage) but I think we should choose 
better names for the methods in StaticProperty, also better names for 
USER_PATH and SYS_PATH because they don't obvious map to the values of 
java.library.path and sun.boot.library.path. What would you think about 
rename them so that the usages in ClassLibrary.LibraryPath are 
StaticProperty.javaLibraryPath() and StaticProperty.sunBootLibrayPath() ?

Minor nit but the comment at (old) line 446 of 
BuiltinClassLoader/findMiscResources has been deleted, I think we should 
keep that to remind the reader why map may be null.

-Alan


More information about the core-libs-dev mailing list