-
Bug
-
Resolution: Fixed
-
P2
-
5.0u4, 7
-
b27
-
x86, sparc
-
linux, solaris_10
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2196656 | 6u30 | Vaibhav Choudhary | P3 | Closed | Fixed | b08 |
JDK-2175501 | 5.0u17 | Vaibhav Choudhary | P3 | Resolved | Fixed | b04 |
JDK-2163334 | 5.0u15-rev | Vaibhav Choudhary | P2 | Resolved | Fixed | b13 |
Can't compile the code provided below with JDK 1.5 and with "-target 1.5" in case of Java 6.
Output error for Java 6 (similar for JDK 1.5 without options):
% javac -target 1.5 Crash.java
An exception has occurred in the compiler (1.6.0). 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.AssertionError: com.sun.tools.javac.jvm.Gen$1ComplexityScanner
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.visitWildcard(Gen.java:1538)
at com.sun.tools.javac.tree.JCTree$JCWildcard.accept(JCTree.java:1746)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:43)
at com.sun.tools.javac.tree.TreeScanner.visitTypeApply(TreeScanner.java:254)
at com.sun.tools.javac.tree.JCTree$JCTypeApply.accept(JCTree.java:1697)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.visitVarDef(TreeScanner.java:80) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:691)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:43)
at com.sun.tools.javac.tree.TreeScanner.visitBlock(TreeScanner.java:88)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.visitForLoop(TreeScanner.java:105)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.visitForLoop(Gen.java:1476)
at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:818)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:43)
at com.sun.tools.javac.tree.TreeScanner.visitBlock(TreeScanner.java:88)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.jvm.Gen.estimateCodeComplexity(Gen.java:1542)
at com.sun.tools.javac.jvm.Gen.visitTry(Gen.java:1268)
at com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:967)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:660)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:695)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:681)
at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:732)
at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:985)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:660)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:695)
at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:918)
at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:854)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:639)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:660)
at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2163)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:617)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1289)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1259)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:69)
at com.sun.tools.javac.Main.main(Main.java:54)
The code:
-------------------------
public class Crash {
public static void main(String[] argv){
TreeSet<Father> sons = new TreeSet<Father>();
try{
}
catch(Throwable t){
}
finally{
for(Father<?> son : sons)
{
son.clear();
}
}
}
}
abstract class Father<T extends Father>
{
public void clear(){
}
}
class Son extends Father<Son>
{
}
---------------------------------------------
Output error for Java 6 (similar for JDK 1.5 without options):
% javac -target 1.5 Crash.java
An exception has occurred in the compiler (1.6.0). 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.AssertionError: com.sun.tools.javac.jvm.Gen$1ComplexityScanner
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.visitWildcard(Gen.java:1538)
at com.sun.tools.javac.tree.JCTree$JCWildcard.accept(JCTree.java:1746)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:43)
at com.sun.tools.javac.tree.TreeScanner.visitTypeApply(TreeScanner.java:254)
at com.sun.tools.javac.tree.JCTree$JCTypeApply.accept(JCTree.java:1697)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.visitVarDef(TreeScanner.java:80) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:691)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:43)
at com.sun.tools.javac.tree.TreeScanner.visitBlock(TreeScanner.java:88)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.visitForLoop(TreeScanner.java:105)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.visitForLoop(Gen.java:1476)
at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:818)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:35)
at com.sun.tools.javac.jvm.Gen$1ComplexityScanner.scan(Gen.java:1468)
at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:43)
at com.sun.tools.javac.tree.TreeScanner.visitBlock(TreeScanner.java:88)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.jvm.Gen.estimateCodeComplexity(Gen.java:1542)
at com.sun.tools.javac.jvm.Gen.visitTry(Gen.java:1268)
at com.sun.tools.javac.tree.JCTree$JCTry.accept(JCTree.java:967)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:660)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:695)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:681)
at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:732)
at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:985)
at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:660)
at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:695)
at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:918)
at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:854)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:639)
at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:660)
at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2163)
at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:617)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1289)
at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1259)
at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:69)
at com.sun.tools.javac.Main.main(Main.java:54)
The code:
-------------------------
public class Crash {
public static void main(String[] argv){
TreeSet<Father> sons = new TreeSet<Father>();
try{
}
catch(Throwable t){
}
finally{
for(Father<?> son : sons)
{
son.clear();
}
}
}
}
abstract class Father<T extends Father>
{
public void clear(){
}
}
class Son extends Father<Son>
{
}
---------------------------------------------
- backported by
-
JDK-2163334 Foreach loop with generics inside finally block crashes javac with -target 1.5
- Resolved
-
JDK-2175501 Foreach loop with generics inside finally block crashes javac with -target 1.5
- Resolved
-
JDK-2196656 Foreach loop with generics inside finally block crashes javac with -target 1.5
- Closed
- duplicates
-
JDK-6679509 The compiler generates non-erased code when translating enhanced for loops
- Closed
- relates to
-
JDK-6910550 javac 1.5.0_17 fails with incorrect error message
- Closed