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

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Oct 31 15:01:31 UTC 2018


OK

-- Jon

On 10/31/18 3:50 AM, Jan Lahoda wrote:
> 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