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
if (type == null) {
						JavaPlugin.logErrorMessage("AddImportOnSelectionAction: Failed to resolve TypeRef: " + chosen.toString()); 
						MessageDialog.openError(getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), JavaEditorMessages.getString("AddImportOnSelection.error.notresolved.message")); 
						return;
					}
					removeQualification(doc, nameStart, chosen);
					
					CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
					AddImportsOperation op= new AddImportsOperation(cu, new IJavaElement[] { type }, settings, false);
					ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell());
					try {
						dialog.run(false, true, new WorkbenchRunnableAdapter(op));
					} catch (InvocationTargetException e) {
						JavaPlugin.log(e);
						MessageDialog.openError(getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), e.getTargetException().getMessage()); 
					} catch (InterruptedException e) {
						
					}
					return;
				} catch (CoreException e) {
					JavaPlugin.log(e);
					ErrorDialog.openError(getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), null, e.getStatus()); 
				} catch (BadLocationException e) {
					JavaPlugin.log(e);
					MessageDialog.openError(getShell(), JavaEditorMessages.getString("AddImportOnSelection.error.title"), e.getMessage()); 
				}
			}
		}		
	}