Bug 18163 Add Import should ignore leading/trailing whitespace
It often happens to me that I have selected i.e. "Node " instead of "Node" because I made my selection by using "Shift + Ctrl + Right". When I then use Ctrl+M (Add Import) nothing happens because of the trailing whitespace within the selection.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
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();
		int docLen= doc.getLength();
		if ((containerLen > 0) && (nameStart + containerLen + 1 < docLen)) {
			for (int k= 0; k < containerLen; k++) {
				if (doc.getChar(nameStart + k) != containerName.charAt(k)) {
					return;
				}
			}