Community
Participate
Working Groups
build I20050823-0800 + jdtcore head 1) create class files X.class and X$Inner.class with the following source public class X { public class Inner { public Inner() {} } } 2) Find the IType corresponding to X.Inner. 3) Get methods of X.Inner with IType#getMethods(). there is one IMethod with one parameter: Inner(X) 4) Get the name range of this method with IMethod#getNameRange(). the result isn't correct and is a range of [offset=-1, length=0]. IType t = getType(...); IMethod[] ms = t.getMethods(); ISourceRange sr = ms[0].getNameRange(); If you look inside the SourceMapper, you will find a name range for the Inner() method but not for Inner(X).
Created attachment 154126 [details] Proposed fix + regression test Fix is trivial. A constructor with a parameter was properly handled, but not a constructor without any parameter.
Released for 3.6M5. Regression test added in: org.eclipse.jdt.core.tests.model.AttachSourceTests#testGetNameRange04
Verified for 3.6M5 using build I20100122-0800