Review Request: JDK-8165563 ClassLoader::getSystemClassLoader will never be null

David Holmes david.holmes at
Thu Sep 8 02:53:33 UTC 2016

Hi Mandy,

On 8/09/2016 5:42 AM, Mandy Chung wrote:
> Webrev:
> ClassLoader::getPlatformClassLoader [1] is added in JDK 9 that is parent or ancestor of the system class loader [1].  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.
> Mandy
> [1]

More information about the core-libs-dev mailing list