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
private int getNameStart(IDocument doc, int pos) throws BadLocationException {
		while (pos > 0) {
			char ch= doc.getChar(pos - 1);
			if (!Character.isJavaIdentifierPart(ch) && ch != '.') {
				return pos;
			}
			pos--;
		}
		return pos;
	}
	
	private int getNameEnd(IDocument doc, int pos) throws BadLocationException {
		int len= doc.getLength();
		while (pos < len) {
			char ch= doc.getChar(pos);
			if (!Character.isJavaIdentifierPart(ch)) {
				return pos;
			}
			pos++;
		}
		return pos;
	}		
	
	private void removeQualification(IDocument doc, int nameStart, TypeInfo typeInfo) throws BadLocationException {
		String containerName= typeInfo.getTypeContainerName();
		int containerLen= containerName.length();
		if (containerLen > 0) {
			for (int k= 0; k < containerLen; k++) {
				if (doc.getChar(nameStart + k) != containerName.charAt(k)) {
					return;