Bug 44450 - Strange name range for anonymous classes.
Summary: Strange name range for anonymous classes.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-08 10:55 EDT by Dirk Baeumer CLA
Modified: 2003-11-21 12:30 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 Dirk Baeumer CLA 2003-10-08 10:55:12 EDT
I20031007

For the following example

public class A {
	public void foo() {
		A a= new A() {};
		class C {
			
		}
	}
}

the name range of the anonymous type new A() {} is [390, 3] which denotes "A
()". Since parenthesis aren't part of the AST it isn't possible to find the 
anonymous class in the AST using the name range. The name range should somehow 
correspond to a node in the AST so that it is easy to find the corresponding 
node. One idea is [390, 1].
Comment 1 Jerome Lanneluc CLA 2003-11-03 12:12:23 EST
Changed SourceElementParser to use the source end of the type reference in the 
case of an anonymous type.

Added regression test GetSourceTests.testNameRangeAnonymous()
Comment 2 David Audel CLA 2003-11-21 12:30:25 EST
Verified.