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

get no err msg if label wrapped in parentheses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • tools
    • merlin
    • generic
    • generic
    • Verified



      Name: krC82822 Date: 12/03/2000


      orig synopsis: "Labels must be identifiers"

      java version "1.3.0" (and 1.4 beta43 -- see below)
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      JDK 1.1 correctly rejected this code, but JDK 1.3 compiles it. According to the
      JLS (14.7), labels must be identifiers, and parenthesis don't fit the bill.

      class foo {
        void bar() {
          int i;
          (a): i = 1;
        }
      }

      ======================================================================

      neal.gafter@Eng 2000-12-04:

      I verified the problem, as follows:

      frog$ cat -n foo.java
           1
           2 class foo {
           3 void bar() {
           4 int i;
           5 (a): i = 1;
           6 }
           7 }
      frog$ javac1.3 foo.java
      frog$

      neal.gafter@Eng 2000-12-04

      ======================================================================

            gafter Neal Gafter (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: