-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
sparc
-
solaris_2.5.1
Name: laC46010 Date: 07/21/97
Declaration of an anonymous inner class with null keyword as a
parameter causes javac to throw sun.tools.java.CompilerError.
All JDK compilers from 1.1_Final thru 1.2C fail to compile
example "Test.java" (see source below), producing the following
compile-time exception:
> /export/ld14/java/dest/jdk1.2/solaris/bin/javac -d . Test.java
sun.tools.java.CompilerError: stackSize null
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(Throwable.java:89)
at java.lang.Error.<init>(Error.java:61)
at sun.tools.java.CompilerError.<init>(CompilerError.java:37)
at sun.tools.java.Type.stackSize(Type.java:342)
at sun.tools.tree.Context.declare(Context.java:116)
at sun.tools.javac.SourceMember.check(SourceMember.java:376)
at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:922)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:685)
at sun.tools.javac.SourceClass.checkLocalClass(SourceClass.java:1126)
at sun.tools.tree.NewInstanceExpression.checkValue(NewInstanceExpression.java:144)
at sun.tools.tree.Expression.checkInitializer(Expression.java:173)
at sun.tools.javac.SourceMember.check(SourceMember.java:434)
at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:908)
at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:685)
at sun.tools.javac.SourceClass.check(SourceClass.java:636)
at sun.tools.javac.Main.compile(Main.java:312)
at sun.tools.javac.Main.main(Main.java:467)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
--------------------Test.java----------------------
class Test {
Object o = new Object( null ) {};
}
--------------------------------------------------------------------------------
======================================================================
- duplicates
-
JDK-4054689 Anonymous inner class with null constructor parameter throws compiler error
- Closed