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

jdk 1.3.x does not compile Java2d Samples [static finals in switch statements]

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 1.3.1
    • 1.3.0
    • client-libs
    • 2d
    • ladybird
    • x86
    • windows_2000

    Description



      Name: krC82822 Date: 05/20/2001


      20 May 2001, eval1127@eng -- v1.3/1.4 compilers are stricter re. expressions
      (even "constant expressions") in swtich statements,

      Constant expressions are described in section 15.28 of the JLS (2nd edition):

          http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5308

      We should revise our examples to conform to the newer compiler's restrictions,
      per bugs such as # 4282697 and others noted at:

      http://search.java.sun.com/Search/java?qt=%2Bcompiler+%2B1.3+%2B%22constant+expression+required%22+%2B%22static+final%22+&col=obug&rf=0
      -----------------
      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      The java 2d examples provided on this page:

      http://java.sun.com/products/java-media/2D/samples/suite/index.html

      does either not compile or run using the provided batch file or using the
      command line. This is the errors:

      C:\Temp\Java2D-samples\Arcs_Curves>javac *.java
      Curves.java:94: constant expression required
                                  case f.SEG_MOVETO :
                                        ^
      Curves.java:96: constant expression required
                                  case f.SEG_LINETO :
                                        ^
      Curves.java:99: constant expression required
                                  case f.SEG_CUBICTO :
                                        ^
      Curves.java:100: constant expression required
                                  case f.SEG_QUADTO :
                                        ^
      Curves.java:119: constant expression required
                                  case f.SEG_MOVETO:
                                        ^
      Curves.java:120: constant expression required
                                  case f.SEG_LINETO:
                                        ^
      6 errors
      (Review ID: 124689)
      ======================================================================

      Attachments

        Activity

          People

            jballsunw Jennifer Ball (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: