Bug 47415

Summary: [Search] package references confused with multiple fragments
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tjbishop
Version: 2.1.2   
Target Milestone: 2.1.3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2003-11-25 08:43:48 EST
Build Eclipse 2.1.2

On the following setup, select package fragment 'p' located in project B and 
search for references. It will incorrectly report 2 matches:

Project A
 +- package p
      +- A.java

Project B prereqs A
 +- package p
 |    +- B.java
 +- package c
      +- C.java
           package c;
           import p.A;
           import p.B;
           public class C {
           }
Comment 1 Philipe Mulet CLA 2003-11-25 08:46:32 EST
Problem comes from the fact we do not consider the focus element when matching 
inside import references. 

We likely have the same bug in qualified name or qualified type references.
Comment 2 Philipe Mulet CLA 2003-11-25 12:08:24 EST
Solved by checking for type existence in package fragment element (if provided).
Addresses import ref, qualified type ref and qualified name ref; both source 
and binary.

Need some regression tests, and need to also fix in 3.0 stream.

Fixed
Comment 3 Jerome Lanneluc CLA 2003-11-25 12:48:44 EST
Added regression test JavaSearchMultipleProjectsTests.testPackageReference() in 
2.1 maintenance stream.
Comment 4 Philipe Mulet CLA 2003-11-26 05:52:09 EST
Fix adapted and released in 3.0 stream
Comment 5 Philipe Mulet CLA 2003-11-26 06:01:47 EST
Fixed
Comment 6 Jerome Lanneluc CLA 2003-11-26 06:22:19 EST
Regression tests ported to 3.0 stream.
Comment 7 David Audel CLA 2003-12-17 10:58:42 EST
Verified for 3.0M6
Comment 8 Frederic Fusier CLA 2004-03-01 13:34:07 EST
Verified for 2.1.3 with build M200402251535.