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

NPE for illegall super call with MethodReference

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Introduced In Version:
      8
    • CPU:
      generic
    • OS:
      generic

      Description

      In JDK8(u40, latest 8u-dev) will crash by the following clode:
      (JDK9 works fine)

      public class Test
      {
          public Test()
          {
              super(A::a);
          }
      }

      Exception is following:
      java.lang.NullPointerException
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitIdent(Flow.java:2377)
      at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.tree.TreeScanner.visitReference(TreeScanner.java:268)
      at com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:1973)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExpr(Flow.java:1624)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scanExprs(Flow.java:1636)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitApply(Flow.java:2233)
      at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:175)
      at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1296)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitBlock(Flow.java:1843)
      at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitMethodDef(Flow.java:1780)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:2546)
      at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.visitClassDef(Flow.java:1733)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:2525)
      at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.scan(Flow.java:1382)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2420)
      at com.sun.tools.javac.comp.Flow$AbstractAssignAnalyzer.analyzeTree(Flow.java:2403)
      at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:211)
      at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1327)
      at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1296)
      at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
      at com.sun.tools.javac.main.Main.compile(Main.java:523)
      at com.sun.tools.javac.main.Main.compile(Main.java:381)
      at com.sun.tools.javac.main.Main.compile(Main.java:370)
      at com.sun.tools.javac.main.Main.compile(Main.java:361)
      at com.sun.tools.javac.Main.compile(Main.java:56)
      at com.sun.tools.javac.Main.main(Main.java:42)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shinyafox Shinya Yoshida
                Reporter:
                shinyafox Shinya Yoshida
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: