-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b57
-
sparc
-
solaris_9
Running "apt -print" on a file containing the following causes apt to crash:
class A extends Unknown {
}
The error message and stack trace:
T12.java:1: cannot find symbol
symbol: class Unknown
...
class AAn exception has occurred in the compiler (1.5.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) 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.comp.PrintAP$PrintingVisitors$PrePrinting.visitClassDeclaration(PrintAP.java:82)
The method PrePrinting.visitClassDeclaration() assumes that the
ClassType.getDeclaration() method cannot return null. It can.
The PrintingVisitors.printInterfaces() method has the same problem.
This is an easy error to make. Thought should be given to the API
design issues around this for a future release.
Incidentally, the error message should ideally not have indicated an
error "in the compiler". And there seems to be a newline missing before
"An exception has occurred".
======================================================================