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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: