Bug 22756 - Reference search does not respect package fragments scope
Summary: Reference search does not respect package fragments scope
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 30731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-23 04:41 EDT by Dani Megert CLA
Modified: 2003-02-07 05:25 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 Dani Megert CLA 2002-08-23 04:41:27 EDT
Build 20020820

Setup:
Project A contains package fragment p with class K
Project B also contains package fragment p
Project C in class D references class K (i.e. p.K)

When I now search for references to B.p (i.e. the package fragment p in B) it
also returns reference to A.p (from C.D)

This is also affects the rename refactoring: when renaming B.p it suggests to
also rename the p in D resulting in an invalid workspace (because p in A did not
change).
Comment 1 Dani Megert CLA 2002-08-23 04:41:49 EDT
oops. was for core.
Comment 2 Jerome Lanneluc CLA 2002-08-27 05:42:42 EDT
Package fragment reference is transformed into a package reference internaly. 
Thus we loose the package fragment root info.

Note that the underlying compiler support doesn't know about pkg fragment root, 
so getting this right in search would require a lot of work.
Comment 3 Dani Megert CLA 2002-08-27 08:09:18 EDT
Worse than the Search (result)is the fact that it breaks refactoring. The
resulting code doesn't compile any longer.
Comment 4 Philipe Mulet CLA 2003-02-04 06:00:31 EST
We could restrain search to projects referring directly/indirectly onto the 
root of the target element (if cannot see it on its expanded classpath of 
candidate, then no point looking into it).
Comment 5 Jerome Lanneluc CLA 2003-02-04 09:52:13 EST
Changed index selector to return indexes of projects or jars that can see the 
referenced element if any. Also filter working copies that cannot see the 
referenced element.
Comment 6 David Audel CLA 2003-02-06 10:24:49 EST
*** Bug 30731 has been marked as a duplicate of this bug. ***
Comment 7 David Audel CLA 2003-02-07 05:25:25 EST
Verified.