Bug 47415 - [Search] package references confused with multiple fragments
Summary: [Search] package references confused with multiple fragments
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1.3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-25 08:43 EST by Philipe Mulet CLA
Modified: 2004-03-01 13:34 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.