Review Request: JDK-8165563 ClassLoader::getSystemClassLoader will never be null
david.holmes at oracle.com
Thu Sep 8 02:53:33 UTC 2016
On 8/09/2016 5:42 AM, Mandy Chung wrote:
> ClassLoader::getPlatformClassLoader  is added in JDK 9 that is parent or ancestor of the system class loader . The system class loader will never be null. Another relevant change in JDK 9 was that the system initialization was reworked that the built-in system class loader is initialized very early during startup.
Despite code to contrary, I don't think the system classloader has
"ever" been allowed to be null. If it can't be constructed then the
whole initialization process will fail with an exception.
But the changes taking advantage of that look good! :)
> This patch updates ClassLoader::getSystemClassLoader to return a non-null system class loader and the implementation of a few methods to handle the null system class loader case.
>  http://download.java.net/java/jdk9/docs/api/java/lang/ClassLoader.html#builtinLoaders
More information about the core-libs-dev