Bug 26124

Summary: JACKS - Compile error not reported when break; used in a labeled statement
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2002-11-13 11:50:24 EST
Using 1112, the compiler doesn't report any error for the following test case:
class A {
    void foo() {
        a: break;
    }
}

Javac 1.3 and 1.4.1 report:
A.java:3: break outside switch or loop
        a: break;
           ^
1 error
Comment 1 Philipe Mulet CLA 2002-11-14 06:17:54 EST
Note that the followings are still accepted:

a: break a;

while(true) 
  a: break;  // will break the while loop

Fixed. Regression test addded (NegativeTest#test292)
Comment 2 Philipe Mulet CLA 2002-11-14 06:18:33 EST
Fixed
Comment 3 Philipe Mulet CLA 2002-11-14 07:10:14 EST
Fixed
Comment 4 David Audel CLA 2002-12-17 10:13:14 EST
Verified.