Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 255759

Summary: Syntax recovery should recognize enum constructor
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Mike_Wilson, Olivier_Thomann, philippe_mulet
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description David Audel CLA 2008-11-19 04:36:43 EST
3.5M3 

The following code is complaining about missing constructor. This comes from the fact that 'BadEnum' got recovered as an enum constant instead of a constructor. 
Similar to our support for methods with missing return type (not always a constructor), enum constants should be checked when recovered. 
In this case, "BadEnum(BadEnum self)" should be recognized as a constructor header, instead of a broken enum constant. 

enum BadEnum { 
    IMPOSSIBLE(BadEnum.IMPOSSIBLE), // COMMA instead of SEMICOLON 
    private BadEnum(BadEnum self) { 
    } 
} 

Note that the following is still legal. 

enum GoodEnum { 
   GoodEnum; 
}
Comment 1 Mike Wilson CLA 2009-05-05 12:21:21 EDT
Changing Version tag to something more believable.
Comment 2 Eclipse Genie CLA 2020-02-13 16:53:06 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.