Bug 106814 [code manipulation] 'Add import' leaves '.' before type name
Build id: I20050627-1435 Does not happen always, seps are like this: 1. Type a class name within method body and hit Ctrl + Space to resolve class - this adds fully qualified class since auto imports are disabled. 2. Type '.' and access a field. Code looks like this: com.some.util.TypeDocs.SALES_MEMO 3. Hit Ctrl+Shif+M to add import. Import is added, but the dot before class name remains and must be removed manually. Code is like this: .TypeDocs.SALES_MEMO
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java
buf.append("}\n");
		assertEqualString(cu.getSource(), buf.toString());
	}
	public void testAddImports2() throws Exception {
		IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src");
		IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null);
		StringBuffer buf= new StringBuffer();
		buf.append("package pack1;\n");
		buf.append("\n");
		buf.append("import java.util.Set;\n");
		buf.append("import java.util.Vector;\n");
		buf.append("\n");
		buf.append("public class C {\n");
		buf.append("}\n");
		ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
		String[] order= new String[] { "java", "java.util", "com", "pack" };
		ImportsStructure imports= new ImportsStructure(cu, order, 2, true);
		imports.addImport("java.x.Socket");
		imports.create(true, null);
		buf= new StringBuffer();
		buf.append("package pack1;\n");
		buf.append("\n");
		buf.append("import java.x.Socket;\n");
		buf.append("\n");		
		buf.append("import java.util.Set;\n");
		buf.append("import java.util.Vector;\n");
		buf.append("\n");
		buf.append("public class C {\n");
		buf.append("}\n");
		assertEqualString(cu.getSource(), buf.toString());