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

javac, crash with lambda expression

    XMLWordPrintable

Details

    • x86
    • windows_vista

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0"
      Java(TM) SE Runtime Environment (build 1.8.0-b126)
      Java HotSpot(TM) Client VM (build 25.0-b67, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      javac can't compile the following program and throws an exception:
      -----
      //import java.awt.event.*;
      import javax.swing.*;

      public class Test1 {
          public static void main(String[] args) {
              SwingUtilities.invokeLater(() -> {
                  JFrame frame = new JFrame("Test");
                  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  JButton button = new JButton("Test");
                  button.addActionListener(new ActionListener() {
                      @Override
                      public void actionPerformed(ActionEvent e) {
                      }
                  });
                  frame.add(button);
                  frame.setSize(160, 160);
                  frame.setVisible(true);
              });
          }
      }
      -----

      -----
      java.lang.NullPointerException
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitMethodDef(Flow.java:497)
              at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:772)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitClassDef(Flow.java:475)
              at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:687)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitNewClass(Flow.java:702)
              at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1510)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitApply(Flow.java:695)
              at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1459)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:175)
              at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1290)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.scanStat(Flow.java:433)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.scanStats(Flow.java:441)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitBlock(Flow.java:525)
              at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:903)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.scanStat(Flow.java:433)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.visitLambda(Flow.java:718)
              at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1618)
              at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
              at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:389)
              at com.sun.tools.javac.comp.Flow$AliveAnalyzer.analyzeTree(Flow.java:746)
              at com.sun.tools.javac.comp.Flow.analyzeLambda(Flow.java:226)
              at com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2393)
              at com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1618)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
              at com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:372)
              at com.sun.tools.javac.comp.DeferredAttr$2.complete(DeferredAttr.java:265)
              at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:231)
              at com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:218)
              at com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:976)
              at com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:822)
              at com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:733)
              at com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:831)
              at com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:578)
              at com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1418)
              at com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1597)
              at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1668)
              at com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1641)
              at com.sun.tools.javac.comp.Resolve$9.doLookup(Resolve.java:2397)
              at com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3056)
              at com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3307)
              at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2394)
              at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2388)
              at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:3363)
              at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3257)
              at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1891)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
              at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1828)
              at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1459)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
              at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:645)
              at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:1596)
              at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1290)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
              at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:681)
              at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1127)
              at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:903)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
              at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1020)
              at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:772)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:596)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:665)
              at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4305)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4215)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4149)
              at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4124)
              at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1251)
              at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:904)
              at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:863)
              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)
      -----

      I can't view the bug which was submitted via http://bugs.sun.com/ on 2013-12-18.
      http://bugs.java.com/bugdatabase/view_bug.do?bug_id=9009012
      https://bugs.openjdk.java.net/browse/JDK-9009012

      I can't send an email to jbs_jpginfra_support_ww_grp@oracle.com and a message via https://bugs.openjdk.java.net/secure/ContactAdministrators!default.jspa.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Issue Links

          Activity

            People

              vromero Vicente Arturo Romero Zaldivar
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: