8241770: Module xxxAnnotation() methods throw NCDFE if module-info.class found as resource in unnamed module

Mandy Chung mandy.chung at oracle.com
Wed Jun 10 21:22:13 UTC 2020



On 6/10/20 12:51 PM, Alan Bateman wrote:
>
> This is a bug in Module.getXXXAnnotation implementation where it 
> accidentally locates a module-info.class on the class path (say if 
> someone deploys a modular JAR on the class path). An oversight in the 
> original implementation. Simple fix to override loadClass to do the 
> right thing. I've kept the changes as minimal as possible as this is a 
> change that may need to be back-ported. The webrev with the change and 
> updated test is here:
>
> http://cr.openjdk.java.net/~alanb/8241770/webrev/
>

Looks good.

Nit: A typo in the test s/reflectingly/reflectively/

102 * Test reflectingly reading annotations on a named module where the 
module Mandy



More information about the jigsaw-dev mailing list