Bug 12044 - [search] Should find constant references in .class files with source attached
Summary: [search] Should find constant references in .class files with source attached
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P5 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: readme
: 226660 (view as bug list)
Depends on:
Blocks: 319854
  Show dependency tree
 
Reported: 2002-03-21 11:57 EST by Dani Megert CLA
Modified: 2021-09-08 14:39 EDT (History)
8 users (show)

See Also:


Attachments
Fix prototype (146.04 KB, patch)
2008-10-15 06:47 EDT, Frederic Fusier CLA
no flags Details | Diff
New patch prototype (56.27 KB, patch)
2008-10-15 08:42 EDT, Frederic Fusier CLA
no flags Details | Diff
New patch prototype (152.82 KB, patch)
2008-10-15 08:44 EDT, Frederic Fusier CLA
no flags Details | Diff
New prototype (153.49 KB, patch)
2008-10-15 12:18 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Support for queues with different priorities in JobManager/IndexManager (15.69 KB, patch)
2008-10-16 12:14 EDT, Jerome Lanneluc CLA
no flags Details | Diff
New prototype merged with new support for queues (177.99 KB, patch)
2008-10-16 12:41 EDT, Frederic Fusier CLA
no flags Details | Diff
Patch proposed for 3.5M3 (130.32 KB, patch)
2008-11-04 10:56 EST, Frederic Fusier CLA
no flags Details | Diff
Last patch updated on top of v_925 (130.32 KB, patch)
2008-11-21 12:35 EST, 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 Dani Megert CLA 2002-03-21 11:57:36 EST
1. In Outline view select java.text.DateFormat.HOUR_OF_DAY0_FIELD
2. Search for References in workspace
==> nothing found

Note 1: It finds references in .java files but not in JARs.
Note 2: Search for all Occurrences (via search dialog) correctly returns the
references
Comment 1 Dani Megert CLA 2002-03-21 12:20:06 EST
Test Case above is bogus.

Replace DateFormat.HOUR_OF_DAY0_FIELD in above test case with JavaCore.ATT_HANDLE_ID
Comment 2 Philipe Mulet CLA 2002-03-21 13:37:52 EST
Constants are inlined inside binaries, and thus cannot be found from the 
classfile themselves (which no longer refer to the searched field).
We would have to consider the attached sources, this is not on the plan.

Closing
Comment 3 Dani Megert CLA 2002-03-21 13:46:45 EST
I assumed this reaction BUT: it is not understandable why Search for all
occurrences finds the references.

If searching for reference is the problem then why don't you search for the
occurrences first then subtract the declarations?

Try it out for JavaCore.ATT_HANDLE_ID
Comment 4 Jerome Lanneluc CLA 2002-04-08 07:37:23 EDT
We can fix this only if we index the attached source. For now, this is a known 
problem and will have to be documented.
Comment 5 Dani Megert CLA 2002-07-01 11:51:17 EDT
Fixed in builds > 20020701
Comment 6 Dani Megert CLA 2002-07-01 12:12:20 EDT
.
Comment 7 Dani Megert CLA 2002-07-02 08:17:43 EDT
OOPS! Touched the wrong bug. Restoring its state to LATER.
Comment 8 Dani Megert CLA 2002-07-02 08:18:11 EDT
OOPS! Touched the wrong bug. Restoring its state to LATER.
Comment 9 Philipe Mulet CLA 2002-07-25 06:59:40 EDT
Reopening
Comment 10 Philipe Mulet CLA 2002-07-25 07:00:57 EDT
Clearing resolution
Comment 11 Philipe Mulet CLA 2002-07-25 07:31:50 EDT
Unclear we can do any better, easily.
Please investigate what would be the impact on the indexes (doubling the index 
size is not an option).
Comment 12 Philipe Mulet CLA 2003-02-03 11:37:56 EST
Deferring, shouldn't have been resurrected at this stage.
Comment 13 Jerome Lanneluc CLA 2008-09-25 04:57:11 EDT
Reopening to consider for 3.5
Comment 14 Jerome Lanneluc CLA 2008-09-25 05:02:40 EDT
One way to achieve this would be to index the attached source when present (instead of indexing the .class file).
Comment 15 Jerome Lanneluc CLA 2008-09-25 06:44:58 EDT
Changing title to better reflect the purpose of this bug.
Comment 16 Frederic Fusier CLA 2008-10-15 06:47:16 EDT
Created attachment 115133 [details]
Fix prototype

This patch solves the problem but is not finalized yet:
1) there are still some failing tests while running RunJavaSearchTests...
2) the way to get sources in AddJarFileToIndex assumes that files are in a peculiar order in the jar. May be this should be changed to get rid of this assumption...
3) most important point: the time to index jar files with attached sources is 8 times longer than while indexing only the binaries!
Comment 17 Frederic Fusier CLA 2008-10-15 08:42:13 EDT
Created attachment 115139 [details]
New patch prototype

Fix issue while running performance tests which highlight the big regression...
Comment 18 Frederic Fusier CLA 2008-10-15 08:44:26 EDT
Created attachment 115140 [details]
New patch prototype

Ooops, I forgot to include changes on o.e.jdt.core.tests.model in previous patch...
Comment 19 Jerome Lanneluc CLA 2008-10-15 12:18:50 EDT
Created attachment 115157 [details]
New prototype

This ensures that the Java model is not populated just to read the source name attribute in the .class file
Comment 20 Jerome Lanneluc CLA 2008-10-16 12:14:04 EDT
Created attachment 115271 [details]
Support for queues with different priorities in JobManager/IndexManager
Comment 21 Frederic Fusier CLA 2008-10-16 12:41:58 EDT
Created attachment 115273 [details]
New prototype merged with new support for queues

This prototype fixes comment 16 point 2) and includes the support for queues with different priorities in JobManager/IndexManager added by Jerome.

It also adds 2 new tests in JavaSearchBugTests, so added tests now cover the following scenarios:
1) jar file with sources inside
2) jar file with source in a another zip file
3) jar file with source in a folder

These 3 scenarios are now supported by this patch, but there are still several failures (28) while running RunJavaSearchTests, hence it's still a prototype...
Comment 22 Jerome Lanneluc CLA 2008-10-29 06:15:01 EDT
Deferring to M4
Comment 23 Frederic Fusier CLA 2008-11-04 10:56:23 EST
Created attachment 116951 [details]
Patch proposed for 3.5M3

This patch passed all JDT tests but was not released into M3 as its design didn't receive the agreement of all reviewers...

The proposed design alternative would be to keep one queue for the indexing but have a master switch (likely a preference) to explicitly enrich the indexes with attached sources.

So, we still need to decide which design will be used to address this issue...
Comment 24 Frederic Fusier CLA 2008-11-21 12:35:50 EST
Created attachment 118501 [details]
Last patch updated on top of v_925

Finally, no real agreement was possible on this bug... :-(

Modifying the indexing to allow priority queues could destabilize this part of Search and have unpredictable bugs arriving late in the game. It also does not prevent plug-in to launch low priority requests at the early beginning and slow down dramatically (may be 8 times slower!) products depending on it. This does not sound reasonable.

Having a master switch may lead to users hitting the performance issue when starting a workspace which needs a full re-indexing, but having forgot that the preference was changed in this workspace a long time ago; then, of course, raising a bug against JDT/Core complaining that the indexing is slower with the new version!

The last point is that it looks that nobody else than us (JDT) complains about this missing search matches... Either users use workaround the problem by importing source in the workspace (as I do) or never realize that there's a problem here...

So, for all these reasons, the conclusion on this is that we stop work on this bug and we will remove it from the 3.5 plan, then wait for stronger needs before restart work in this area...

Note that all the work already done here won't be done in vain as I found bug 251504 which may explain most of the unresolved problem with indexing (see bug 161409, bug 215271 and bug 108749)!
Comment 25 Andrew Eisenberg CLA 2009-12-08 13:32:52 EST
Is there any chance that this bug can be fixed in the 3.6 stream?  You had mentioned that no one complains about this bug.  But that is not true.  *I* complain about it (albeit silently, whereas I should have raised a bug).  :-)
Comment 26 Satyam Kandula CLA 2010-07-15 02:57:42 EDT
*** Bug 226660 has been marked as a duplicate of this bug. ***
Comment 27 Eclipse Genie CLA 2020-04-22 15:40:52 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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 28 dct trnh CLA 2021-09-08 14:39:07 EDT
Reopening