RFR: JDK-8213103: RoundEnvironment.getElementsAnnotatedWith(Class) crashes with -source 8

Jan Lahoda jan.lahoda at oracle.com
Wed Oct 31 10:50:19 UTC 2018


Hi,

When RoundEnvironment.getElementsAnnotatedWith(Class) converts the Class 
to TypeElement, it uses:
eltUtils.getTypeElement(eltUtils.getModuleElement(<class-module-name>), 
<class-name>)

But this fails with -source 8, as there are no module (so 
getModuleElement returns null, and getTypeElement checks the module 
parameter is non-null). The proposed fix is to avoid this code.

Bug: https://bugs.openjdk.java.net/browse/JDK-8213103
Webrev: http://cr.openjdk.java.net/~jlahoda/8213103/webrev.00/index.html

Any feedback is welcome,
     Jan


More information about the compiler-dev mailing list