Bug 226313

Summary: Anonymous enum type has wrong name and source range
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.4   
Target Milestone: 3.4 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix and regression tests none

Description Markus Keller CLA 2008-04-09 12:10:28 EDT
I20080408-0800

package a.b;
enum Color {
	RED, BLUE(1), GREEN() {};
	Color(int i) {}
	Color() { new Cloneable() {}; }
}

Look at the IType for GREEN (child of the IField):
- #getNameRange() is "{" after GREEN, expected "GREEN"
- #getSourceRange is from 0 to after "... GREEN() {}", expected "GREEN() {}"

Hint: First doubleclick on element in JavaElement view is name range, second doubleclick is source range.
Comment 1 Jerome Lanneluc CLA 2008-04-10 08:03:30 EDT
Created attachment 95505 [details]
Proposed fix and regression tests
Comment 2 Jerome Lanneluc CLA 2008-04-10 10:38:49 EDT
Fix and tests released for 3.4M7
Comment 3 Maxime Daniel CLA 2008-04-29 05:41:21 EDT
Verified for 3.4 M7 using build I20080427-2000.