Bug 66190 - Method reference searching in editor view
Summary: Method reference searching in editor view
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-08 13:54 EDT by Rob Dingwell CLA
Modified: 2004-10-27 06:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Dingwell CLA 2004-06-08 13:54:45 EDT
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.
Comment 1 Rob Dingwell CLA 2004-06-08 14:21:14 EDT
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..
Comment 2 Philipe Mulet CLA 2004-06-08 15:29:35 EDT
Can you pls provide steps to reproduce and reopen afterwards ?
Comment 3 Rob Dingwell CLA 2004-06-09 12:25:05 EDT
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.





Comment 4 Frederic Fusier CLA 2004-07-26 07:30:05 EDT
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