-
Bug
-
Resolution: Fixed
-
P3
-
21, 22, 23
-
b04
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8325555 | 22.0.1 | Jan Lahoda | P3 | Resolved | Fixed | b04 |
JDK-8323203 | 21.0.3-oracle | Jan Lahoda | P3 | Resolved | Fixed | b02 |
JDK-8323052 | 21.0.3 | Aleksey Shipilev | P3 | Resolved | Fixed | b01 |
---
package test;
public class Demo {
public Demo() {
Unknown.test();
}
}
---
When compiled with -Xlint:this-escape and should-stop at FLOW, this will crash:
---
$ ./build/linux-x86_64-server-release/images/jdk/bin/javac -Xlint:all -XDshould-stop.at=FLOW -XDdev /tmp/Demo.java
/tmp/Demo.java:6: error: cannot find symbol
Unknown.test();
^
symbol: variable Unknown
location: class Demo
1 error
An exception has occurred in the compiler (23.0.1-internal). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://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.ClassCastException: class com.sun.tools.javac.code.Symbol$ClassSymbol cannot be cast to class com.sun.tools.javac.code.Symbol$MethodSymbol (com.sun.tools.javac.code.Symbol$ClassSymbol and com.sun.tools.javac.code.Symbol$MethodSymbol are in module jdk.compiler of loader 'app')
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.visitApply(ThisEscapeAnalyzer.java:509)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1819)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:50)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.scan(ThisEscapeAnalyzer.java:462)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.visitExec(ThisEscapeAnalyzer.java:922)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1606)
at jdk.compiler/com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:50)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.scan(ThisEscapeAnalyzer.java:462)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.analyzeStatements(ThisEscapeAnalyzer.java:419)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.lambda$analyzeTree$6(ThisEscapeAnalyzer.java:358)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.visitScoped(ThisEscapeAnalyzer.java:1109)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.visitTopLevel(ThisEscapeAnalyzer.java:1059)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.lambda$analyzeTree$7(ThisEscapeAnalyzer.java:357)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611)
at jdk.compiler/com.sun.tools.javac.comp.ThisEscapeAnalyzer.analyzeTree(ThisEscapeAnalyzer.java:356)
at jdk.compiler/com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:234)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1426)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1400)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:976)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
printing javac parameters to: /home/jlahoda/src/jdk/jdk/javac.20231215_075855.args
---
Originally reported as:
https://github.com/apache/netbeans/issues/6826
- backported by
-
JDK-8323052 ThisEscapeAnalyzer crashes for erroneous code
- Resolved
-
JDK-8323203 ThisEscapeAnalyzer crashes for erroneous code
- Resolved
-
JDK-8325555 ThisEscapeAnalyzer crashes for erroneous code
- Resolved
- links to
-
Commit openjdk/jdk21u-dev/5f2cf881
-
Commit openjdk/jdk22u/1d338556
-
Commit openjdk/jdk/7455b1b5
-
Review openjdk/jdk21u-dev/117
-
Review openjdk/jdk22/26
-
Review openjdk/jdk22u/41
-
Review openjdk/jdk/17118