NPE in FlowAnalyzer.visitApply (com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null)
Dawid Weiss
dawid.weiss at gmail.com
Fri Jun 11 13:08:37 UTC 2021
For the record - this also applies to JDK14 (not just JDK16+).
Dawid
On Fri, Jun 11, 2021 at 12:59 PM Srikanth Adayapalam
<srikanth.adayapalam at oracle.com> wrote:
>
> Thanks for the report, this seems to be a duplicate of https://bugs.openjdk.java.net/browse/JDK-8262095
>
> I will add a note to that ticket so this test case could be included in the verification process.
>
> Thanks!
> Srikanth
> ________________________________
> From: compiler-dev <compiler-dev-retn at openjdk.java.net> on behalf of Dawid Weiss <dawid.weiss at gmail.com>
> Sent: 11 June 2021 15:06
> To: compiler-dev <compiler-dev at openjdk.java.net>
> Cc: Uwe Schindler (SD DataSolutions GmbH) <uwe at thetaphi.de>
> Subject: NPE in FlowAnalyzer.visitApply (com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null)
>
> I get this simple snippet to fail the compiler on JDK 14 all the way
> up to 16.0.1/ 2021-04-20:
>
> import com.google.inject.Guice;
> import com.google.inject.Key;
> import com.google.inject.TypeLiteral;
>
> import java.lang.annotation.Retention;
> import java.util.LinkedHashSet;
>
> public class Repro {
> public static void main(String[] args) {
> LinkedHashSet<String> fieldSet =
> Guice.createInjector().getInstance(Key.get(new TypeLiteral<>()
> {}, Retention.class));
> }
> }
>
> Couldn't isolate it without using Guice JAR - it's probably trivial,
> sorry. The full repro is at [1] and you can run it with:
>
> javac -cp guice-5.0.1.jar Repro.java
>
> I see some NPE related issues marked as fixed in jira but this seems
> to be unrelated (as it still causes the crash).
>
> Hope this helps.
>
> Dawid
>
> [1] https://github.com/dweiss/javac-bug
More information about the compiler-dev
mailing list