Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8336320

NullPointerException: Cannot invoke Type.getTag because type is null after JDK-8334037

    XMLWordPrintable

Details

    • b07

    Description

      After the fix for JDK-8334037, javac crashes on the following input when --release 11 is configured:

      class T {
        public void f() {
          Runnable r = new I()::m;
        }

        private class I{
          private void m() {}
        }
      }


      $ javac -fullversion --release 11 T.java
      An exception has occurred in the compiler (24-internal). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
      java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.getTag()" because "type" is null
              at jdk.compiler/com.sun.tools.javac.jvm.Code.typecode(Code.java:245)
              at jdk.compiler/com.sun.tools.javac.jvm.Items$Item.coerce(Items.java:271)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:861)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genArgs(Gen.java:884)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitNewClass(Gen.java:2041)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1912)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:859)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitVarDef(Gen.java:1063)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1063)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:588)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:623)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:609)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStats(Gen.java:660)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitLetExpr(Gen.java:2451)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$LetExpr.accept(JCTree.java:3408)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:859)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitVarDef(Gen.java:1063)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1063)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:588)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:623)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:609)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStats(Gen.java:660)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.internalVisitBlock(Gen.java:1121)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:1085)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1133)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:588)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:623)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:949)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:912)
              at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:957)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:588)
              at jdk.compiler/com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2494)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:770)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1702)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1670)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:977)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
              at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
              at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)

      Attachments

        Issue Links

          Activity

            People

              mcimadamore Maurizio Cimadamore
              cushon Liam Miller-Cushon
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: