Details
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
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
- relates to
-
JDK-8258897 Wrong translation of capturing local classes inside nested lambdas
- Resolved
-
JDK-8267610 NPE at at jdk.compiler/com.sun.tools.javac.jvm.Code.emitop
- Resolved