Bug 50230 Paste omits a character
20040119 - In the following text, double click on 'rel' to get the word selected. - CTRL + C - Set cursor between empty brackets, paste -> only pastes 'el', the letter 'r' is gone protected Object getAttribute(Object parent, int childProperty) { if (child instanceof List) { } else if (rel != null && !rel.equals(child)) { } else if () return child; }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
if (pos < 0)
				return false;
			if (pos != 0 && Character.isJavaIdentifierPart(text.charAt(pos - 1)))
				return false;
			if (pos + 3 < length && Character.isJavaIdentifierPart(text.charAt(pos + 3)))
				return false;
			
			return true;
		} catch (BadLocationException e) {
		}
		return false;
	}
	/**
	 * Checks whether the content of <code>document</code> at <code>position</code> looks like an
	 * anonymous class definition. <code>position</code> must be to the left of the opening
	 * parenthesis of the definition's parameter list.
	 * 
	 * @param document the document being modified
	 * @param position the first character position in <code>document</code> to be considered
	 * @param partitioning the document partitioning
	 * @return <code>true</code> if the content of <code>document</code> looks like an anonymous class definition, <code>false</code> otherwise
	 */
	private static boolean looksLikeAnonymousClassDef(IDocument document, String partitioning, JavaHeuristicScanner scanner, int position) {
		int previousCommaOrParen= scanner.scanBackward(position - 1, JavaHeuristicScanner.UNBOUND, new char[] {',', '('});
		if (previousCommaOrParen == -1 || position < previousCommaOrParen + 5) 
			return false;
		if (isNewMatch(document, previousCommaOrParen + 1, position - previousCommaOrParen - 2, partitioning))
			return true;
		return false;
	}