Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4230296

Occured error for "null is a Compile Time Constant".

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.0
    • tools
    • 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)
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: