Bug 26124 - JACKS - Compile error not reported when break; used in a labeled statement
Summary: JACKS - Compile error not reported when break; used in a labeled statement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-13 11:50 EST by Olivier Thomann CLA
Modified: 2002-12-17 10:13 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.