Bug 122906 [quick fix] add unimplemented method does not consider name conflicts
Version: 3.2.0 Build id: I20060105-0800 Having: package ibm.util; public class Properties {} package ibm.util; import java.util.Properties; public interface F { public void b(Properties p); public void g(ibm.util.Properties p); } package ibm.util; public class Test implements F { } Then applying quick fix 'add unimplemented methods' results in: package ibm.util; import java.util.Properties; public class Test implements F { public void b(Properties p) {} public void g(Properties p) {} } But should be: package ibm.util; import java.util.Properties; public class Test implements F { public void b(Properties p) {} public void g(ibm.util.Properties p) {} } or: package ibm.util; import ibm.util.Properties; public class Test implements F { public void b(java.util.Properties p) {} public void g(Properties p) {} }
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java
buf.append("package test1;\n");
		buf.append("public class B {\n");
		buf.append("}\n");	
		String content2= buf.toString();
		ICompilationUnit cu2= pack1.createCompilationUnit("B.java", content2, false, null);
		
		String[] order= new String[] { "java.util", "java.io", "java.net" };
		int threshold= 99;
		AST ast= AST.newAST(AST.JLS3);
		NewImportRewrite importsRewrite= newImportsRewrite(cu2, order, threshold, true);
		{
			IJavaElement[] elements= cu1.codeSelect(content.indexOf("Map"), "Map".length());
			assertEquals(1, elements.length);
			String key= ((IType) elements[0]).getKey();
			String signature= new BindingKey(key).internalToSignature();
			
			importsRewrite.addImportFromSignature(signature, ast);
		}			
		
		apply(importsRewrite);
		
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("\n");
		buf.append("import java.util.Map;\n");
		buf.append("import java.util.Set;\n");
		buf.append("\n");
		buf.append("import java.net.ServerSocket;\n");
		buf.append("\n");
		buf.append("public class B {\n");