Community
Participate
Working Groups
Choosing refactor > rename of EclipseTest.test to EclipseTest.test1 on the following code: public class EclipseTest { public int test = 0; public static void main(String[] args) { EclipseTest test = new EclipseTest() test.test = 1; } } produces the following code: public class EclipseTest { public int test1 = 0; public static void main(String[] args) { EclipseTest test = new EclipseTest() test1.test = 1; // << Picks the wrong "test" here! } }
With latest (2.0 stream) I am obtaining the following which is still wrong: public class EclipseTest { public int test1 = 0; public static void main(String[] args) { EclipseTest test = new EclipseTest(); test1.test1 = 1; } } This is a search bug. It finds 2 matches for 'test' in 'test.test', the first one being an inaccurate match. It should not be a match at all.
Internally there were 2 problems: - first we transformed the local variable binding into null, which caused us to report an inaccurate match - second the 2 algorithms that compute the source positions of references were mixed up together Fixed the first problem by checking if the binding of the first token was not a local variable binding. Fixed the second problem by separating the 2 algorithms.