Bug 15108 Add import deletes code
Build 20020501 1) Create a class "TestingFoo" in package "Testing". 2) In another package, create a class and method and type "TestingFoo". 3) With the cursor at the end of "TestingFoo", hit Ctrl+Shift+M to add the import. It deletes part of the class name, and all that's left is "oo". I guess it does a match against the package name, and since the package name is a prefix of the class name, it incorrectly deletes part of the class name.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
int nameStart= getNameStart(doc, selection.getOffset());
					int nameEnd= getNameEnd(doc, selection.getOffset() + selection.getLength());
					int len= nameEnd - nameStart;
					
					String name= doc.get(nameStart, len).trim();
					String simpleName= Signature.getSimpleName(name);
					String containerName= Signature.getQualifier(name);
					
					
					IImportDeclaration existingImport= JavaModelUtil.findImport(cu, simpleName);
					if (existingImport != null) {
						if (!existingImport.getElementName().equals(name)) {
							getShell().getDisplay().beep();
						}
						return;
					}			
					
					IJavaSearchScope searchScope= SearchEngine.createJavaSearchScope(new IJavaElement[] { cu.getJavaProject() });
					
					TypeInfo[] types= findAllTypes(simpleName, searchScope, null);
					if (types.length== 0) {
						getShell().getDisplay().beep();
						return;
					}
					
					TypeInfo chosen= selectResult(types, containerName, getShell());
					if (chosen == null) {
						return;
					}
					IType type= chosen.resolveType(searchScope);