Bug 155450 - [search] Search Engine wrongly set some exact method references as potential
Summary: [search] Search Engine wrongly set some exact method references as potential
Status: RESOLVED DUPLICATE of bug 73957
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-28 15:23 EDT by Randy Hudson CLA
Modified: 2008-01-08 05:21 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2006-08-28 15:23:41 EDT
I'm looking at the method ServiceLocator#registerService and I invoke the call hierarchy. I see no hits for this method, which is called in many places. Search Scope is set to "Workspace".

If I invoke search references, I see the references, but they are only "potential" matches. Why are they just potential and not exact hits? Has this behavior changed in 3.2?
Comment 1 Randy Hudson CLA 2006-09-07 13:03:08 EDT
Another scenario:
ILog#log(IStatus)

results in 0 matches found using call hierarchy.
Or 600 using search view.
Comment 2 Jerome Lanneluc CLA 2006-09-08 04:20:47 EDT
This behaves correctly in my workspace (search and call hierarchy find the same 27 refences). Make sure that the search scope of the call hierarchy view (see drop down menu of this view) is set to Workspace.

Please reopen with details steps to reproduce.
Comment 3 Randy Hudson CLA 2006-09-08 10:02:04 EDT
I have a very standard installation of Eclipse 3.2.0 because I just lost my entire hard drive. This bug occurred on my previous setup too. So, Call Hierarchy has all default settings, which include "Workspace" scope.

I have several internal projects loaded from an internal CVS server. These projects depend only on some parts of Constellation.
Comment 4 Randy Hudson CLA 2006-09-08 10:24:02 EDT
I reproduced in a workspace containing some closed projects, and only the GEF Logic example imported as a SRC project. I opened ILog, and searched for the log() method. No hits were found.  I was using the 3.2.0 Release build.  EMF, GEF, and GMF are in my IDE, maybe a few other features.  But only GEF 3.2.0 SDK + Examples should be needed to reproduce the test.

http://www.eclipes.org/gef click on downloads page to get the SDK and Examples ZIP.
Comment 5 Jerome Lanneluc CLA 2006-09-11 04:31:21 EDT
Exact steps to reproduce:
1. Install Eclipse 3.2.x
2. Download GEF 3.2 and examples (http://www.eclipse.org/downloads/download.php?file=/tools/gef/downloads/drops/R-3.2-200606270816/GEF-ALL-3.2.zip)
3. Unzip in Eclipse install (or add a links/gef.link file that points to GEF)
4. Start a new workspace
5. File>Import>Plug-in Development>Plug-ins and Fragments>Next>Projects with source folders>Next>org.eclipse.gef.examples.logic>Add>Finish
6. Open type ILog
7. In Outline, select log(IStatus)
8. <context menu> > Call hierarchy
Observe: the Call hierarchy view doesn't show any children of ILog#log(IStatus)
Comment 6 Frederic Fusier CLA 2006-10-07 15:55:03 EDT
I cannot reproduce the problem even with latest steps provided by Jerome :-(
However, reading again all bug hitsory, I found an interesting point in comment 1:

> results in 0 matches found using call hierarchy.
> Or 600 using search view.

I think this means that problem comes from Call Hierarchy View and not from Search Engine => move to JDT/UI for further investigations.
Comment 7 Randy Hudson CLA 2006-10-08 16:07:25 EDT
> I think this means that problem comes from Call Hierarchy View and not from
> Search Engine => move to JDT/UI for further investigations.

I don't think that is true. All 600 matches are labeled "potential" matches, which is why they are filtered from the hierarchy search.

My best guess is that this bug is related to the "PDE classpath" problem.
Comment 8 Martin Aeschlimann CLA 2006-10-09 09:01:46 EDT
It has to be said that when you're using the PDE 'add to search' feature, these archives can't correctly be resolved as they are not in the context on a classpath and are therefore only reported as potential matches.

So maybe the call hierarchy only adds non-potential matches (I didn't verify) and we should add this option.
Comment 9 Randy Hudson CLA 2006-10-09 10:43:19 EDT
(In reply to comment #8)
> It has to be said that when you're using the PDE 'add to search' feature, these
> archives can't correctly be resolved as they are not in the context on a
> classpath and are therefore only reported as potential matches.
> So maybe the call hierarchy only adds non-potential matches (I didn't verify)
> and we should add this option.

I didn't completely understand that, but the bigger issue is that they are potential matches, not whether I can add potential matches to the call hierarchy search.

Why are they potential matches? This seems to be because of the way the PDE add all dependent JARs within projects in the workspace. This approach seems flawed.  Maybe because there is no implied dependency between two JARs in the same project? For example, if I import "org.eclipse.core.resources" into my workspace, all of a sudden the behavior of the same search returns completely different results (it finds tons of exact matches). The behavior should be the same whether I have a dependency loaded in my workspace or not.
Comment 10 Frederic Fusier CLA 2006-10-12 05:32:12 EDT
OK, I can reproduce it now. My first try was in a self-hosted workspace and it works in this configuration but not using a standard runtime session...

Back to JDT/Core as this is clearly Search Engine issue: it does return all matches as potential ones although some of them should be exact.
Comment 11 Markus Keller CLA 2007-02-22 04:42:48 EST
Probably caused by bug 73957.
Comment 12 Frederic Fusier CLA 2008-01-08 05:21:41 EST

*** This bug has been marked as a duplicate of bug 73957 ***