Bug 33800

Summary: search: reporting too many method occurrences
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Adam Kiezun CLA 2003-03-04 14:45:48 EST
20030227
1. create 2 projects (unrelated)
2. in each create:
- package p
- interface I in p
- class C in p

make both I's look like this:
package p;
public interface I {
    void method(Object o);
}

and C's like this:
package p;
public class C implements I {
    public void method(Object o) {
    }
}

now, select one of the I.method's and search for occurences in workspace
you get 4 results, not 2 as expected

(same happened when i did the search programmatically)
Comment 1 Jerome Lanneluc CLA 2003-03-05 06:10:16 EST
When creating a search pattern from an IJavaElement, focus was set only for 
REFERENCES patterns. Now set it for DECLARATIONS and ALL_OCCURENCES patterns as 
well.

Added regression test JavaSearchMultipleProjectsTests.testMethodOccurences()
Comment 2 David Audel CLA 2003-03-10 11:17:45 EST
Verified.