-
Bug
-
Resolution: Not an Issue
-
P5
-
None
-
8, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Labels with the same name in the same scope are accepted when specified on
statements that are not blocks, contrary to Language Specification Sect. 14.7.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the file below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An error detected.
ACTUAL -
No errors detected.
---------- BEGIN SOURCE ----------
public class ErrLabels {
static void meth(){
lab: ;
lab: return;
}
}
---------- END SOURCE ----------
Labels with the same name in the same scope are accepted when specified on
statements that are not blocks, contrary to Language Specification Sect. 14.7.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the file below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An error detected.
ACTUAL -
No errors detected.
---------- BEGIN SOURCE ----------
public class ErrLabels {
static void meth(){
lab: ;
lab: return;
}
}
---------- END SOURCE ----------
- relates to
-
JDK-4035334 Incorrect scoping for statement labels
-
- Closed
-
-
JDK-1241001 labels with the same name are allowed for nested blocks
-
- Closed
-
-
JDK-4018155 multiple labels with the same name must be flagged as an error
-
- Closed
-