-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.0
-
x86
-
windows_nt
Name: clC74495 Date: 04/16/99
E:\***>\jdk1.2.2\bin\javac const.java
java.lang.ClassCastException: sun.tools.tree.ConditionalExpression
at sun.tools.tree.SwitchStatement.code(SwitchStatement.java:185)
at sun.tools.javac.SourceMember.code(SourceMember.java:825)
at sun.tools.javac.SourceMember.code(SourceMember.java:787)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:2110)
at sun.tools.javac.SourceClass.compile(SourceClass.java:2039)
at sun.tools.javac.Main.compile(Main.java:567)
at sun.tools.javac.Main.main(Main.java:733)
error: ******************** (*: localized character(Japanese))
(mean: Occured exception in compiler)
http://java.sun.com/cgi-bin/bugreport.cgi *****************
(mean: submit bug report, please)
*********** ( mean: error 1)
E:\***>\jdk1.1.8\bin\javac const.java
const.java:9: Constant expression required.
case null == "" ? 1 : 2:
^
1 error
--- const.java
// JLS vs Java2
// null is a Compile Time Constant
// added to 15.27.
class NullIsConst {
public static void main(String[] args) {
switch (args.length) {
case null == "" ? 1 : 2:
;
}
}
}
(Review ID: 57053)
======================================================================
- relates to
-
JDK-4083093 JLS should define null as a compile time constant
- Closed