J2SE Version (please include all output from java -version flag):
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b96)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b96, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
No, works fine with 5.0u9
Operating System Configuration Information (be specific):
Microsoft Windows 2000 [Version 5.00.2195]
An exception has occurred in the compiler (1.6.0-rc)
java.lang.AssertionError
at com.sun.tools.javac.jvm.Code$State.forceStackTop(Code.java:1688)
at com.sun.tools.javac.jvm.Gen.visitConditional(Gen.java:1644)
at com.sun.tools.javac.tree.JCTree$JCConditional.accept(JCTree.java:1021)
at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:813)
at com.sun.tools.javac.jvm.Gen.visitReturn(Gen.java:1591)
at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1138)
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)
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
public class Test extends JCheckBox implements TableCellRenderer {
protected TableCellRenderer getCellRenderer(JTable aTable) {
return aTable.getRowCount() == 0 ? aTable.getDefaultRenderer(Object.class)
: aTable.getRowCount() == 1 ? new Test()
: new DefaultTableCellRenderer() {
public Component getTableCellRendererComponent(JTable aTable, Object aValue,
boolean aSelectedFlag, boolean aHasFocusFlag, int aRowIndex, int aColumnIndex) {
return this;
}
};
}
public Component getTableCellRendererComponent(JTable aTable, Object aValue, boolean aSelectedFlag
, boolean aHasFocusFlag, int aRow, int aColumn) {
return this;
}
}
Compact equivalent test-case (does *not* depends on swing) :
class Base {}
interface I {}
class A1 extends Base implements I {}
class A2 extends Base implements I {}
class Test {
Object crash(I i, A1 a1, A2 a2, boolean b1, boolean b2) {
return b1 ? i : b2 ? a2 : a1;
}
}