Community
Participate
Working Groups
We've found this strange behavior on 3.1M5a. package search; public class SuperClass { public void aMethod(Object x) { } } package search; public class SubClass extends SuperClass { public void aMethod(Object x) { } private void aMethod(String x) { } } package search; public class User { public void methodUsingSubClassMethod() { SuperClass user = new SubClass(); user.aMethod(new Object()); } } When we do a reference search on SubClass.aMethod(Object x), we get the result: search.User.methodUsingSubClassMethod() But if we change the order of the methods in SubClass (see below), no references are found! In Eclipse 3.0.1 the problem does not occur. package search; public class SubClass extends SuperClass { private void aMethod(String x) { } public void aMethod(Object x) { } }
Increase severity of this bug as requested by user: "I would like to suggest that we raise the severity of #88300 to 'critical', since the incomplete search result may lead to the assumption that a method is not called anymore and therefore to the deletion of the method. The compiler would not complain, since the signature is available in the superclass. The code would be available in the attic of the SCM, but this kind of cleaning up could lead to the introduction of subtle bugs. We only found this problem by pure luck and considered it so severe that we decided to switch back to 3.0.1."
In fact, it has been already fixed and released in HEAD stream as we discover by another way (mails titled "Unreferenced methods" on jdt-core-dev@eclipse.org were talking about this issue). When available, you can use this week integration build or next week 3.1 M6 milestone to have this bug fixed. [jdt-core-dev internal] Add specific test cases #testBug88300 and #testBug88300b in JavaSearchBugsTest and rename #testBug70827b as #testBug88300c. Also update buildnotes_jdt-core.html
Verified in I20050330-0500