Community
Participate
Working Groups
Searching for references for a method does not appear to work correctly. Highlighting a method in the editor and searching for references in the workspace causes a search for references to the Class the method is included in not the method that was selected. Selecting the method from the Outline view and searching for the references in the workspace does work however.
Looking into this a bit further this seams isolated to methods that have errors associated with them in the editor. Still odd that it will work from the Outline view for those methods though. R..
Can you pls provide steps to reproduce and reopen afterwards ?
The steps to reproduce are pretty simple. This effects methods that have parameters that JDT cannot resolve the class for. Open up a source file, find a method and put a typo in the Type of one of the parameters to the method, i.e. Stirng instead of String. Next highlight the method and search for references to that method using either the popup menu or the Referenece menu items under the Search menu in the main menu bar. The search that ends up being performed is for references to the Class that the method is in, not the method itself. Next, select the method from the Outline view and do the search for references from there using either the popup menu or the items under the Search Menu. This time the search is performed on the method, bad Parameters and all. Of course this returns no search results.
Cannot reproduce using 3.0 final. Here's my project setup: b66190 A.java public class A { void foo(String str) {} } B.java public class B { void bar() { A a = new A(); a.foo("test"); } } Here are my steps: 1- hightlight foo in A and search references in project => find one in B: OK 2- modify foo signature: void foo(Stirng str), save + build => get one compiler error in A and B: OK 3- hightlight foo in A and search references in project => find no reference: OK Note that if there was a search on method class instead of methid itself, I should have found one in B... I've also run these steps without saving (ie. no build was perfomed) and got same results. I've also search in all workspace instead of project and use both contextual menu or global one and always got same result. I've also do similar tries with existing class in our project and, again, got same result... So, perhaps is there something special with the class on which you get this issue or your workspace. Please try this simple example and let us know if you get or not the same problem and reopen if necessary. Also let us know eclipse version you use. Thx