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