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

multiple labels with the same name must be flagged as an error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.0.2
    • tools
    • None
    • generic
    • solaris_2.5

      The same statement may not have multiple labels with the same name. For
      example, the following program has an error:

      class C {
        void f() {
          int x;
          a: a: x = 0;
        }
      }

      The Java compiler does not indicate this as an error.

      I have already discussed this with Guy Steele who agrees that this is
      an error because the statement "a: x = 0;" is considered to be nested
      within the statement "a: a: x = 0;".

            tturnidgsunw Todd Turnidge (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: