Bug 8358 - Search: doesn't find reference although there are
Summary: Search: doesn't find reference although there are
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-24 07:00 EST by Dirk Baeumer CLA
Modified: 2002-01-29 05:39 EST (History)
3 users (show)

See Also:


Attachments
Workspace that shows the problem (711.40 KB, application/octet-stream)
2002-01-24 07:04 EST, Dirk Baeumer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2002-01-24 07:00:24 EST
Build 20020122

- create a workspace from the attached zip
- open file TestArrayRead in package object_out
- select field field in outliner
- activate search for references in workspace from context menu
  observe: there are two matches
- add a method foo at the end of the class TestArrayRead
- save (there is an autobuild)
- select field field in outliner
- activate search for references in workspace from context menu
  observe: there are 0 matches
- activate search for references in hierarchy from context menu
  observe: there are two matches
Comment 1 Dirk Baeumer CLA 2002-01-24 07:04:15 EST
Created attachment 258 [details]
Workspace that shows the problem
Comment 2 Dani Megert CLA 2002-01-24 08:41:49 EST
I'm not a JCore specialist and therefore what I see as bug might be intentional.
Here is what looks as bugs to me:
1) In MatchLocator.getBinaryInfo the OS path is computed like this:
	String osPath = resource.getFullPath().toOSString();
   This is wrong (it is relative to the project location) and should be:
	String osPath = resource.getLocation();

2) It seems wrong to me that it tries to find matches in class files which
   reside in the output folder (bin) even though the output folder is nested.
   Note: Project setup is to use project as src folder and 'bin' as output
         folder.

1 + 2 together lead in a FileNotFoundException and search is stopped


Moving to JCore for further investigation
Comment 3 Jerome Lanneluc CLA 2002-01-29 05:39:50 EST
There are 2 problems:
- .class files are reported as being changed (see bug 3344) and thus they are 
indexed.
- the match locator is trying to open such a .class file, fails and aborts the 
whole search.

Fixed second problem by catching the exception earlier. This fixes the symptoms 
of this bug report (i.e. the 2 references are now found).
First problem will be fixed when bug 3344 is fixed.