-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b49
-
generic
-
generic
JDK : tiger b48
Platforms[s] : all
testbase : /java/sqe4/tools/1.5.0
Failing tests : javam/regression/5109108
Initializing static with anonymous class crashes apt -print in AptEnv.complete().
Sample is modified form of com/sun/jmx/defaults/ServiceName.java.
public class Test
{
static String getString(Object o) { return o.toString(); }
static class B {
String foo() { return null; }
}
public static final String ASTRING = getString( new B() { String foo(){ return "Hello";} } );
}
/*
% apt -print -nocompile Test.java
An exception has occurred in the compiler (1.5.0-auto-tiger). 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.NullPointerException
at com.sun.tools.apt.mirror.AptEnv.complete(AptEnv.java:82)
at com.sun.tools.apt.mirror.AptEnv.getFlags(AptEnv.java:72)
at com.sun.tools.apt.mirror.declaration.DeclarationMaker.getTypeDeclaration(DeclarationMaker.java:89)
at com.sun.tools.apt.comp.Apt.main(Apt.java:194)
at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:419)
at com.sun.tools.apt.main.Main.compile(Main.java:942)
at com.sun.tools.apt.main.Main.compile(Main.java:830)
at com.sun.tools.apt.Main.compile(Main.java:41)
at com.sun.tools.apt.Main.main(Main.java:32)
*/
----------------------------
A simpler test case:
class B {
Object o =
(new Object() {});
}
###@###.### 2004-04-20
Platforms[s] : all
testbase : /java/sqe4/tools/1.5.0
Failing tests : javam/regression/5109108
Initializing static with anonymous class crashes apt -print in AptEnv.complete().
Sample is modified form of com/sun/jmx/defaults/ServiceName.java.
public class Test
{
static String getString(Object o) { return o.toString(); }
static class B {
String foo() { return null; }
}
public static final String ASTRING = getString( new B() { String foo(){ return "Hello";} } );
}
/*
% apt -print -nocompile Test.java
An exception has occurred in the compiler (1.5.0-auto-tiger). 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.NullPointerException
at com.sun.tools.apt.mirror.AptEnv.complete(AptEnv.java:82)
at com.sun.tools.apt.mirror.AptEnv.getFlags(AptEnv.java:72)
at com.sun.tools.apt.mirror.declaration.DeclarationMaker.getTypeDeclaration(DeclarationMaker.java:89)
at com.sun.tools.apt.comp.Apt.main(Apt.java:194)
at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:419)
at com.sun.tools.apt.main.Main.compile(Main.java:942)
at com.sun.tools.apt.main.Main.compile(Main.java:830)
at com.sun.tools.apt.Main.compile(Main.java:41)
at com.sun.tools.apt.Main.main(Main.java:32)
*/
----------------------------
A simpler test case:
class B {
Object o =
(new Object() {});
}
###@###.### 2004-04-20
- relates to
-
JDK-5025833 compiling annatations with nested enums issuing *.java leads to crash
- Resolved