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

Bug 329365

Summary: Code completion not fully qualifying class name when needed
Product: [Eclipse Project] JDT Reporter: J S <joshua.stewart>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: Olivier_Thomann
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description J S CLA 2010-11-03 11:44:44 EDT
Build Identifier: 20100218-1602

When writing code with multiple classes having the same name, but different packages, code completion always uses an unqualified class name, sometimes resulting in code that will not compile.

Reproducible: Always

Steps to Reproduce:
1. Using the code snippet included below.
2. Place the cursor at the end of the 12th line ("new ArrayLis"). 
3. Perform code completion (Ctrl-Space by default)

The resulting code will not compile because the type argument in ArrayList<Certificate> is not fully qualified as java.security.cert.Certificate.

code snippet below...
=======================
package eclipse.bugs;

import java.security.cert.Certificate;
import java.util.ArrayList;
import java.util.List;

public class CompletionFailure {
	public static void main(String[] args) {
		Certificate cert = null;
		javax.security.cert.Certificate cert2 = null;
		
		List<javax.security.cert.Certificate> certs = new ArrayLis
	}
}
Comment 1 Eclipse Genie CLA 2020-01-30 16:49:12 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. 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.