Bug 226313 - Anonymous enum type has wrong name and source range
Summary: Anonymous enum type has wrong name and source range
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-09 12:10 EDT by Markus Keller CLA
Modified: 2008-04-29 05:41 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix and regression tests (23.44 KB, patch)
2008-04-10 08:03 EDT, Jerome Lanneluc CLA
no flags Details | Diff

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