Community
Participate
Working Groups
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].
Changed SourceElementParser to use the source end of the type reference in the case of an anonymous type. Added regression test GetSourceTests.testNameRangeAnonymous()
Verified.