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

NPE in jdk.compiler/com.sun.tools.javac.jvm.Code.emitop0(Code.java:570)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u221, 11, 14
    • Fix Version/s: 16
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b28
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows Llinux JDK 1.8.0._221

      -sh-4.1$ /scratch/fairoz/JAVA/jdk14/jdk-14-ea+10/bin/javac A.java
      An exception has occurred in the compiler (14-ea). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://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
      at jdk.compiler/com.sun.tools.javac.jvm.Code.emitop0(Code.java:570)
      at jdk.compiler/com.sun.tools.javac.jvm.Items$LocalItem.load(Items.java:399)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genArgs(Gen.java:885)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitNewClass(Gen.java:1938)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1792)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:860)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitExec(Gen.java:1719)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1523)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:597)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:632)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:618)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStats(Gen.java:669)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:1080)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1030)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:597)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genStat(Gen.java:632)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:950)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:913)
      at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:876)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genDef(Gen.java:597)
      at jdk.compiler/com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2391)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:756)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1640)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1608)
      at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:972)
      at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:318)
      at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
      at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
      at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
      printing javac parameters to: /scratch/fairoz/JI/tools/9061951/javac.20190818_215145.args
      A DESCRIPTION OF THE PROBLEM :
      following code can not be compiled.

      import java.util.stream.Stream;
      public class A {
      public static void main(String[] args) {
      Integer a = 1;
      class Inner {
      Inner(int i) {
      System.out.println(i + a);
      }
      }
      Stream.of(1, 2).forEach(o -> new Inner(o) {});
      }
      }


      FREQUENCY : often


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: