Name: viR10068 Date: 09/27/2001
The java compiler throws InternalError when compiling class tstC.java
(see source below) instead of reporting an error.
This class implements interface with an invalid field initializer
(the array of double is initialized by a string constant).
To reproduce bug compile tsti.jasm and tstC.java (tstI.class attached).
See execution log for details.
------------------------tsti.jasm--------------------------
package tst;
interface tstI {
static public final Field mr:"[D" = String "null";
}
------------------------tstC.java--------------------------
package tst;
class tstC implements tstI {
double [] get_mr() {
return mr;
}
}
-----------------------------------------------------------
Execution log:
% java -version
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b80)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b80, mixed mode)
% jasm -d . tsti.jasm && javac -d . tstC.java
An exception has occurred in the compiler (1.4.0-beta3). Please file a bug at the Java
Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug
Parade for duplicates. Include your program and the following diagnostic in your report.
Thank you.
java.lang.InternalError: assertion failed
at com.sun.tools.javac.v8.util.Util.assertion(Util.java:34)
at com.sun.tools.javac.v8.code.Type.constType(Type.java:82)
at com.sun.tools.javac.v8.comp.Attr.checkId(Attr.java:1326)
at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:1171)
at com.sun.tools.javac.v8.tree.Tree$Ident.visit(Tree.java:1083)
at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
at com.sun.tools.javac.v8.comp.Attr.attribExpr(Attr.java:274)
at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:759)
at com.sun.tools.javac.v8.tree.Tree$Return.visit(Tree.java:817)
at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:296)
at com.sun.tools.javac.v8.comp.Attr.attribStats(Attr.java:314)
at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:462)
at com.sun.tools.javac.v8.tree.Tree$Block.visit(Tree.java:539)
at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:296)
at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:415)
at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java:474)
at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:259)
at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:296)
at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:1489)
at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:1456)
at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:396)
at com.sun.tools.javac.v8.Main.compile(Main.java:526)
at com.sun.tools.javac.Main.compile(Main.java:32)
at com.sun.tools.javac.Main.main(Main.java:23)
%
======================================================================