Bug 247045 - [search] for references within jar without sources returns no result
Summary: [search] for references within jar without sources returns no result
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows Server 2003
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-09-11 12:47 EDT by Mike Yawn CLA
Modified: 2024-01-18 09:19 EST (History)
2 users (show)

See Also:


Attachments
This is the source for a plugin that demonstrates the problem (13.17 KB, application/octet-stream)
2008-09-11 12:47 EDT, Mike Yawn CLA
no flags Details
This is the file to search (should find 3 matches) (8.16 KB, application/octet-stream)
2008-09-11 12:48 EDT, Mike Yawn CLA
no flags Details
Patch got from bug 127442 (67.29 KB, patch)
2008-09-15 12:43 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Yawn CLA 2008-09-11 12:47:40 EDT
Created attachment 112327 [details]
This is the source for a plugin that demonstrates the problem

Build ID: I20080617-2000

Steps To Reproduce:
1. I will attach a simple plugin (1 action that invokes a search) that shows the problem.  I'll also attach a jar file that holds classes that should be found by the search.
2. Install the plugin, create a project that references the attached jar, and invoke the plugin's search action.  It will report zero matches found.
3. If desired, you can configure a project as describe in plugin comments (referencing jar through a variable) and see that then the files ARE found by the search.


More information:
See attached plugin.zip and test jar file
Comment 1 Mike Yawn CLA 2008-09-11 12:48:47 EDT
Created attachment 112328 [details]
This is the file to search (should find 3 matches)
Comment 2 Mike Yawn CLA 2008-09-11 13:07:52 EDT
Realized I didn't add sufficient detail on the 'invoke the plugin's search action'.  This plugin installs a right-click action that will be enabled when the selection in the project explorer view is a Project.

The action is labeled 'DEBUG PLUGIN Search this project'.   In my case I set up different projects that included the attached jar files in different ways -- as a local component (/lib subdirectory), as an external jar (referring to C:\tmp\<testjar>, as a component of a dependent project, etc.  

In all cases, the jar itself is visible (I dump out the SearchScope in each case and see that it is present), and the IType within the jar that we use as the base class for the search is always located.  But the types within the jar that extend the base class are not returned when we do a search for implementors (or even when we do a search for all occurrences).
Comment 3 Frederic Fusier CLA 2008-09-11 13:55:56 EDT
I'll investigate
Comment 4 Frederic Fusier CLA 2008-09-15 06:15:03 EDT
The reason why search engine does not find any match is because of the jar file does not have any source attached (see bug 127442). Is it the case in your initial test case or did you forget to attach it when creating your test case?
Comment 5 Mike Yawn CLA 2008-09-15 10:09:17 EDT
That was, in fact, the problem.  Somewhere I'd gotten the idea that the search could work against .class files and didn't need the source.  Once I created a source attachment for the jar files, the search is now returning the expected results.

OK to close or mark invalid.

Thanks!
Comment 6 Frederic Fusier CLA 2008-09-15 12:41:01 EDT
(In reply to comment #5)
> That was, in fact, the problem.  Somewhere I'd gotten the idea that the search
> could work against .class files and didn't need the source.  Once I created a
> source attachment for the jar files, the search is now returning the expected
> results.
> 
> OK to close or mark invalid.
> 
> Thanks!
> 
Instead of closing this bug, I'll use it to track work around this peculiar issue.
Comment 7 Frederic Fusier CLA 2008-09-15 12:43:49 EDT
Created attachment 112559 [details]
Patch got from bug 127442

This patch currently intends to find fields and methods references in .class files which have no attached source. It's neither finalized nor have any regression tests...
Comment 8 Frederic Fusier CLA 2008-09-15 12:51:23 EDT
I surely have no time to continue to work on this problem during 3.5 dvpt process, hence set its priority to P5.

Anyone who wanted to complete the provided patch would be very welcomed :-)
TIA
Comment 9 Eclipse Genie CLA 2019-06-30 20:01:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 10 Stephan Herrmann CLA 2020-02-06 17:52:38 EST
This bug has an advanced patch (carried over from bug 127442). It would be a waste of efforts to totally ignore this.
Comment 11 Eclipse Genie CLA 2022-01-27 04:28:08 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 12 Eclipse Genie CLA 2024-01-18 09:19:28 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.