Bug 41954 - Too many potential matches because of imports
Summary: Too many potential matches because of imports
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-26 06:35 EDT by Jerome Lanneluc CLA
Modified: 2013-10-16 01:24 EDT (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 Jerome Lanneluc CLA 2003-08-26 06:35:06 EDT
Build 20030825

1. Create package p1
2. Create cu A.java in p1:
package p1;
public class A {
}
3. Create package p2
4. Create cu B.java in p2:
package p2;
public class B {
  Object p1;
}
5. Create cu C.java in p2:
package p2;
import p1.A;
public class C extends A {
}
6. Select field B.p1 and search for references in hierarchy

Observe: p2/C.java is found as a potential match in SearchEngine.search
(IWorkspace, ISearchPattern, IJavaSearchScope, IJavaSearchResultCollector)

The only reference to 'p1' is in 'import p1.A;'. We might want to optimize out 
this case.
Comment 1 Philipe Mulet CLA 2003-09-17 07:03:45 EDT
Is this working for free given your latest changes ?
Comment 2 Kent Johnson CLA 2003-09-17 10:59:21 EDT
Jerome: I cannot reproduce this using the latest HEAD contents, can you?
Comment 3 Jerome Lanneluc CLA 2003-09-18 06:50:47 EDT
Yes, I can still reproduce using the latest HEAD content.
Comment 4 Kent Johnson CLA 2003-09-18 10:55:30 EDT
Just to clarify... it is NOT a potential match showing up in the UI.

The question is why is an import statement adding a generic reference to 'p1' 
to the index (which then needs to be resolved to see if its a field ref), when 
it clearly can only be either a package or type ref.
Comment 5 Philipe Mulet CLA 2003-12-09 04:11:26 EST
I don't see any obvious reason for it, though with 1.5 we will have to deal 
with static imports which are likely going to introduce this kind of ambiguity.
Comment 6 Philipe Mulet CLA 2005-04-07 07:34:56 EDT
Deferring post 3.1
Comment 7 Eclipse Webmaster CLA 2009-08-30 02:34:57 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.