Name: poR10007 Date: 05/05/2000
Javac fails to compile a class declaration that has an array
type in the extends clause.
Javac (JDK1.3.0A - JDK1.3.0fcsC) throws NullPointerException
compiling the following test (oldjavac reports an expected
error message):
-Test.java-----------------------------------------------
public class Test extends Object[] {
}
-Compilation log-----------------------------------------
$ java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, interpreted mode)
$ javac -d . Test.java
An exception has occurred in the compiler (1.3.0). Please file a bug at the Java Developer Connection
(http://java.sun.com/cgi-bin/bugreport.cgi). Include your program and the following diagnostic in your
report. Thank you.
java.lang.NullPointerException
at com.sun.tools.javac.v8.comp.Flow._case(Flow.java:746)
at com.sun.tools.javac.v8.tree.Tree$Apply.visit(Tree.java:785)
at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:321)
at com.sun.tools.javac.v8.comp.Flow.analyzeExpr(Flow.java:339)
at com.sun.tools.javac.v8.comp.Flow._case(Flow.java:719)
at com.sun.tools.javac.v8.tree.Tree$Exec.visit(Tree.java:699)
at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:321)
at com.sun.tools.javac.v8.comp.Flow.analyzeStat(Flow.java:394)
at com.sun.tools.javac.v8.comp.Flow.analyzeStats(Flow.java:413)
at com.sun.tools.javac.v8.comp.Flow._case(Flow.java:520)
at com.sun.tools.javac.v8.tree.Tree$Block.visit(Tree.java:492)
at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:321)
at com.sun.tools.javac.v8.comp.Flow.analyzeStat(Flow.java:394)
at com.sun.tools.javac.v8.comp.Flow._case(Flow.java:488)
at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java:441)
at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:321)
at com.sun.tools.javac.v8.comp.Flow.analyzeDef(Flow.java:379)
at com.sun.tools.javac.v8.comp.Flow._case(Flow.java:456)
at com.sun.tools.javac.v8.tree.Tree$ClassDef.visit(Tree.java:402)
at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:321)
at com.sun.tools.javac.v8.comp.Flow.analyzeDef(Flow.java:379)
at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:380)
at com.sun.tools.javac.v8.Main.compile(Main.java:247)
at com.sun.tools.javac.Main.main(Main.java:16)
$ oldjavac -d . Test.java
Test.java:1: '{' expected.
public class Test extends Object[] {
^
1 error
$
---------------------------------------------------------
======================================================================
- duplicates
-
JDK-4352986 Compiler throws exception on invalid inheritance
-
- Closed
-
-
JDK-4357858 javac 1.3 falls on exception
-
- Closed
-