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

javac crash in Flow.AssignAnalyzer.visitIdent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • tools
    • None
    • b108
    • x86
    • linux_ubuntu
    • Verified

      $ cat Crash.java

      import java.util.*;
      import java.util.stream.*;

      public class Crash {

          static class ViewId { }

          public void crash() {

              Map<ViewId,String> viewToProfile = null;
              new TreeMap<>(viewToProfile.entrySet().stream()
                            .collect(Collectors.toMap((vid, prn) -> prn,
                                                      (vid, prn) -> Arrays.asList(vid),
                                                      (a, b) -> { a.addAll(b); return a; })));

          }

      }
      $ javac Crash.java
      An exception has occurred in the compiler (1.8.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitIdent(Flow.java:2262)
      at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:1999)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:382)
      at com.sun.tools.javac.tree.TreeScanner.visitSelect(TreeScanner.java:264)
      at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1892)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExpr(Flow.java:1575)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitApply(Flow.java:2139)
      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:382)
      at com.sun.tools.javac.tree.TreeScanner.visitSelect(TreeScanner.java:264)
      at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1892)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExpr(Flow.java:1575)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitApply(Flow.java:2139)
      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:382)
      at com.sun.tools.javac.tree.TreeScanner.visitSelect(TreeScanner.java:264)
      at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1892)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExpr(Flow.java:1575)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitApply(Flow.java:2139)
      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:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExpr(Flow.java:1575)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.scanExprs(Flow.java:1585)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitNewClass(Flow.java:2145)
      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:382)
      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:382)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitBlock(Flow.java:1779)
      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:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitMethodDef(Flow.java:1720)
      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:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.visitClassDef(Flow.java:1680)
      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:382)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.analyzeTree(Flow.java:2307)
      at com.sun.tools.javac.comp.Flow$AssignAnalyzer.analyzeTree(Flow.java:2288)
      at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:210)
      at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1321)
      at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1295)
      at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:900)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:859)
      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:64)
      at com.sun.tools.javac.Main.main(Main.java:50)
      $ java -version
      java version "1.8.0-ea"
      Java(TM) SE Runtime Environment (build 1.8.0-ea-b105)
      Java HotSpot(TM) Server VM (build 25.0-b47, mixed mode)
      $

            vromero Vicente Arturo Romero Zaldivar
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: