Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 443411 - [search] references to type finds potential matches in 1.8 JDK JARs in a 1.3 project (search engine uses wrong compliance)
Summary: [search] references to type finds potential matches in 1.8 JDK JARs in a 1.3 ...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Manoj N Palat CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-05 09:42 EDT by Markus Keller CLA
Modified: 2019-10-31 15:37 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot (91.67 KB, image/png)
2014-09-05 09:42 EDT, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2014-09-05 09:42:17 EDT
Created attachment 246773 [details]
Screenshot

master

Setup:
- launch a new workspace with a 1.8 JDK (with source attachments, i.e. not a JRE)
- create a new Java Project using EE: J2SE-1.3
- paste this class:
package my;
public class Control {
	Control c;
}
- select 'Control', press Ctrl+H, and apply settings as in screenshot (search for references to type in workspace, including JRE Libraries)

=> The search engine wrongly reports potential (inaccurate) matches in the JDK. The problem seems to be that the source attachment on the rt.jar is parsed with a wrong source level. The project's source level must not be used as source level for source attachments of libraries. The actual source level is not available, but the best guess is the Util#getJdkLevel(Object) of the JAR.

I think the bug is in MatchLocator#locateMatches(SearchDocument[]) line 1313 and in MatchLocator#initialize(JavaProject, int): The assumption that the project's lookup environment can be used to parse JAR contents is wrong.

This bug is the reason for bug 443410 (RenameTypePerfAcceptanceTests#testCold fails). But that test is brittle anyway and I'll fix by using a 1.3 JRE.
Comment 1 Jay Arthanareeswaran CLA 2014-09-05 10:34:58 EDT
Manoj, please take this forward.
Comment 2 Manoj N Palat CLA 2014-09-12 00:16:02 EDT
Sure Jay. And thanks Markus for the hints - we do get null binding for nodes of the possible matches resulting in potential (inaccurate) matches as listed - solution under investigation.
Comment 3 Eclipse Genie CLA 2019-10-31 15:37:11 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.