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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Alan Bateman

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
Reply | Threaded
Open this post in threaded view
|

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

Claes Redestad
Looks good to me.

/Claes

On 2017-12-05 15:11, Alan Bateman wrote:

>
> 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

Reply | Threaded
Open this post in threaded view
|

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

Mandy Chung
In reply to this post by Alan Bateman
+1

Mandy

On 12/5/17 6:11 AM, Alan Bateman wrote:

>
> 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