ClassLoader.getParent to throw exception for module classloader

Alan Bateman Alan.Bateman at oracle.com
Fri Jun 22 03:40:41 PDT 2012


On 22/06/2012 11:20, Rémi Forax wrote:
>
> instanceof is evil :)
Sure but it is necessary because getParent is final (and can't be made 
non-final without open a big hole). Once ModuleClassLoader is final then 
an alternative would of course be to just check the class.

> and having a method that document that a module classloader has not 
> the same behavior
> as a 'raw' classloader is a good idea (but maybe the method should be 
> moved in ClassLoader).
Yes, a big update to the javadoc will be required, including ClassLoader 
and java.lang.module.ModuleClassLoader.

-Alan.



More information about the jigsaw-dev mailing list