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("    Vector c= null;\n");
			buf.append("}\n");
			assertEqualString(doc.get(), buf.toString());
		} finally {
			FileBuffers.getTextFileBufferManager().disconnect(path, null);
		}
	}
	
	public void testAddImportAction2() 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.lang.System;\n");
		buf.append("\n");		
		buf.append("public class C {\n");
		buf.append("    Vector c= null;\n");
		buf.append("}\n");
		ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null);
		
		IPath path= cu.getPath();
		
		FileBuffers.getTextFileBufferManager().connect(path, null);
		try {
			IDocument doc= FileBuffers.getTextFileBufferManager().getTextFileBuffer(path).getDocument();
			int selOffset= buf.indexOf("Vector");
		
			AddImportsOperation op= new AddImportsOperation(cu, doc, selOffset, 0, null);
			op.run(null);