Bug 45349 [typing] Smart ; must replace selection
I20031015 1. enter "int a= 3;" 2. select "=3;" 3. press ";"
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.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, int position, String partitioning) {
		int previousCommaOrParen= scanBackward(document, position - 1, partitioning, -1, new char[] {',', '('});
		if (previousCommaOrParen == -1 || position < previousCommaOrParen + 5) 
			return false;
		if (isNewMatch(document, previousCommaOrParen + 1, position - previousCommaOrParen - 2, partitioning))
			return true;
		return false;
	}