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
command.offset= position;
		command.length= 0;
		command.caretOffset= position;
		command.text= adjustSpacing(document, position, fCharacter);
		command.doit= true;
		command.owner= null;
	}
	/**
	 * Adds a space before a brace if it is inserted after a parenthesis, equal sign, or one
	 * of the keywords <code>try, else, do</code>. 
	 * 
	 * @param document the document we are working on
	 * @param position the insert position of <code>character</code>
	 * @param character the character to be inserted
	 * @return a <code>String</code> consisting of <code>character</code> plus any additional spacing
	 */
	private String adjustSpacing(IDocument doc, int position, char character) {
		if (character == BRACECHAR) {
			if (position > 0 && position <= doc.getLength()) {
				int pos= position - 1;
				if (looksLike(doc, pos, ")") 
				|| looksLike(doc, pos, "=") 
				|| looksLike(doc, pos, "]") 
				|| looksLike(doc, pos, "try") 
				|| looksLike(doc, pos, "else") 
				|| looksLike(doc, pos, "synchronized") 
				|| looksLike(doc, pos, "static") 
				|| looksLike(doc, pos, "finally") 
				|| looksLike(doc, pos, "do"))