NPE in FlowAnalyzer.visitApply (com.sun.tools.javac.code.Type.getThrownTypes()" because "tree.meth.type" is null)

Srikanth Adayapalam srikanth.adayapalam at oracle.com
Fri Jun 11 10:59:54 UTC 2021


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20210611/8ca4dd9a/attachment.htm>


More information about the compiler-dev mailing list