Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349672

Summary: [content assist] doesn't qualify type if a type with the same name is in package
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P4 CC: daniel_megert
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Markus Keller CLA 2011-06-17 06:55:08 EDT
3.5.2 and later (probably older, didn't check)

In the example below, invoke content assist after "Integ" and choose "Integer - java.lang". This doesn't qualify the type with java.lang, although a type with the same name is declared in the package and thus shadows the java.lang type.

Works fine if the other class "Integer" is declared in another package and imported via a fully qualified import statement. Doesn't work if the other class is imported via a *-import.


package contentassist;
public interface Integer {
	int ABC= 1;
}

package contentassist;
public class ContentAssistTest {
	void foo() {
		int i= Integ
	}
}
Comment 1 Dani Megert CLA 2011-06-17 10:18:50 EDT
Broken since day 1.

The core proposal is:

[TYPE_REF]{completion:Integer, declSign:java.lang, sign:Ljava.lang.Integer;, declKey:, key:, name:, replace:[124,128], token:[124,128], relevance:27}

Ayush, can you test whether the standard cases still work when you fix the completion string to be fully qualified?
Comment 2 Dani Megert CLA 2012-02-20 10:00:28 EST
Same problem for types outside java.lang.
Comment 3 Eclipse Genie CLA 2019-09-09 14:14:36 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.