Bug 22756

Summary: Reference search does not respect package fragments scope
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ekuleshov
Version: 2.0   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.