Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in GenericAnnotatedTypeFactory.getFirstNodeOfKindForTree( #612

Closed
cushon opened this issue Oct 24, 2023 · 0 comments · Fixed by #619
Closed

NullPointerException in GenericAnnotatedTypeFactory.getFirstNodeOfKindForTree( #612

cushon opened this issue Oct 24, 2023 · 0 comments · Fixed by #619

Comments

@cushon
Copy link

cushon commented Oct 24, 2023

New in 3.39.0-eisop1:

interface A {}

@interface B {
  Class<? extends A> value();
}

class C implements A {}

class E {}

public @interface Z {
  abstract class D implements A {

    public D() {
      g(new E());
    }

    static void g(Object... xs) {}
  }
}
error: SourceChecker.typeProcess: unexpected Throwable (NullPointerException) while processing Z.java
  ; The Checker Framework crashed.  Please report the crash.  Version: Checker Framework 3.39.0-eisop1.
  Checker: class org.checkerframework.checker.nullness.NullnessChecker
  Visitor: class org.checkerframework.checker.initialization.InitializationVisitor
  Compilation unit: Z.java
  Last visited tree at line 15 column 13:
        g(new E());
  Exception: java.lang.NullPointerException; java.lang.NullPointerException
        at org.checkerframework.framework.type.GenericAnnotatedTypeFactory.getFirstNodeOfKindForTree(GenericAnnotatedTypeFactory.java:1299)
        at org.checkerframework.framework.type.GenericAnnotatedTypeFactory.getAnnotatedTypeVarargsArray(GenericAnnotatedTypeFactory.java:1839)
        at org.checkerframework.common.basetype.BaseTypeVisitor.checkVarargs(BaseTypeVisitor.java:2129)
        at org.checkerframework.common.basetype.BaseTypeVisitor.visitMethodInvocation(BaseTypeVisitor.java:2012)
        at org.checkerframework.checker.initialization.InitializationVisitor.visitMethodInvocation(InitializationVisitor.java:299)
        at org.checkerframework.checker.initialization.InitializationVisitor.visitMethodInvocation(InitializationVisitor.java:66)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1666)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
        at org.checkerframework.framework.source.SourceVisitor.scan(SourceVisitor.java:95)
        at org.checkerframework.common.basetype.BaseTypeVisitor.scan(BaseTypeVisitor.java:437)
        at org.checkerframework.common.basetype.BaseTypeVisitor.scan(BaseTypeVisitor.java:194)
        at jdk.compiler/com.sun.source.util.TreeScanner.visitExpressionStatement(TreeScanner.java:433)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1476)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
        at org.checkerframework.framework.source.SourceVisitor.scan(SourceVisitor.java:95)
        at org.checkerframework.common.basetype.BaseTypeVisitor.scan(BaseTypeVisitor.java:437)
        at org.checkerframework.common.basetype.BaseTypeVisitor.scan(BaseTypeVisitor.java:194)
        at jdk.compiler/com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:90)
        at jdk.compiler/com.sun.source.util.TreeScanner.scan(TreeScanner.java:105)
        at jdk.compiler/com.sun.source.util.TreeScanner.visitBlock(TreeScanner.java:248)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1048)
        at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant