8182742: ClassLoader.getResourceXXX throws NPE when ClassLoader created by defineModulesWithXXX

Alan Bateman Alan.Bateman at oracle.com
Tue Dec 5 14:11:01 UTC 2017


I need a Reviewer for a trivial change to the class loaders that support 
the ModuleLayer defineModulesWithXXXLoader methods. These methods create 
one or many class loaders to load classes/resources from the modules in 
the layer. The parent of these class loaders is specified to these 
method to support loading classes that are not in modules. A corner 
cases arises when the parent is specified as null, the implementation 
doesn't handle this correctly for the case that the loader(s) 
getResourceXXX methods attempt to locate a resource via the null loader. 
The issue came up too late to fix in JDK 9. The changes to fix this are 
trivial.

http://cr.openjdk.java.net/~alanb/8182742/webrev/index.html

-Alan


More information about the jigsaw-dev mailing list