Bug 169419 - [search] Some references to ISaveablesLifecycleListener.class not found when target is lower than 1.5
Summary: [search] Some references to ISaveablesLifecycleListener.class not found when ...
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-03 07:24 EST by Dani Megert CLA
Modified: 2007-02-05 11:45 EST (History)
2 users (show)

See Also:


Attachments
Small JAR file to reproduce the problem (1.41 KB, application/octet-stream)
2007-01-09 12:05 EST, Frederic Fusier CLA
no flags Details
Small JAR file to reproduce the problem (3.08 KB, application/octet-stream)
2007-01-09 12:54 EST, Frederic Fusier CLA
no flags Details
JAR file compiled using 1.5 compliance to verify that problem did not occur (2.82 KB, application/octet-stream)
2007-01-09 12:57 EST, Frederic Fusier CLA
no flags Details
Proposed fix (2.25 KB, patch)
2007-01-09 13:05 EST, Olivier Thomann 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 2007-01-03 07:24:07 EST
I20061219-1300

I have org.eclipse.ui.workbench.texteditor in HEAD and all required plug-ins imported as binary. If I search all references to ISaveablesLifecycleListener (either via search dialog or by selecting ISaveablesLifecycleListener and then use the context menu) search does not report the following reference in Workbench.initializeDefaultServices():
	serviceLocator.registerService(ISaveablesLifecycleListener.class,
		new SaveablesList());
Comment 1 Frederic Fusier CLA 2007-01-09 11:35:29 EST
Reproduced with 3.3 M4 and also with 3.2 (this reference did not exist before...).
It seems that the BinaryIndexer fails to put this reference found in Workbench.class file in index and so search does not parse corresponding source. I'll investigate...
Comment 2 Frederic Fusier CLA 2007-01-09 12:05:35 EST
Created attachment 56636 [details]
Small JAR file to reproduce the problem

Detach this JAR file and put it on a build path of a 1.4 project. Then expand this JAR under the project and try to find reference to pack.ISaveablesLifecycleListener => no reference is found.
Comment 3 Frederic Fusier CLA 2007-01-09 12:09:38 EST
Problem comes from the fact that T.class does not generate a direct constant field "reference" when compliance is lower than 5.0...

Olivier, please update the summary, thanks
Comment 4 Olivier Thomann CLA 2007-01-09 12:49:45 EST
Update title
Comment 5 Frederic Fusier CLA 2007-01-09 12:54:39 EST
Created attachment 56641 [details]
Small JAR file to reproduce the problem

Previous attached JAR file was not valid, this one should be ok...
Comment 6 Frederic Fusier CLA 2007-01-09 12:57:58 EST
Created attachment 56642 [details]
JAR file compiled using 1.5 compliance to verify that problem did not occur

With this JAR file built using 1.5 compliance, reference is well found by Search Engine...
Comment 7 Olivier Thomann CLA 2007-01-09 12:59:42 EST
Reopen.
Comment 8 Olivier Thomann CLA 2007-01-09 13:05:05 EST
Created attachment 56643 [details]
Proposed fix

I am afraid that with this fix we can fix references to things that are not types.
I'll test it more.
Comment 9 Frederic Fusier CLA 2007-01-09 13:12:33 EST
(In reply to comment #8)
> Created an attachment (id=56643) [details]
> Proposed fix
> 
> I am afraid that with this fix we can fix references to things that are not
> types.
> I'll test it more.
> 
I agree. So, I think this fix could be used only if we can clearly identify that the String tag has been used for a constant field reference...

Comment 10 Olivier Thomann CLA 2007-01-09 15:09:19 EST
The only way to be sure that we don't dump too many "non-type" reference would be to index the bytecodes.
By this, I mean that we should index the string constant used as an argument of Class.forName. This must be (or at least is expected to be) a class name.
But this might slow down the binary indexer.
Comment 11 Frederic Fusier CLA 2007-01-11 09:36:48 EST
I discussed about this problem with Philippe and our conclusion is that it would be too much risky and complicated changes for a small benefit. We agree that Search Engine misses a references but as it can only be in a .class file, refactoring is not concerned and so this should not have too bad consequences.

Note also that it only happens when compiler source level is lower than 1.5, so we can consider it will not be a problem in the future...

So, close as WONTFIX.
Comment 12 Dani Megert CLA 2007-01-11 09:41:00 EST
>Note also that it only happens when compiler source level is lower than 1.5, so
>we can consider it will not be a problem in the future...
Wrong. Note that most of Eclipse code base will never move to 5.0 and hence future will not be of a big help here.