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
return new String(new char[] { ' ', character });
			}
		}
		return new String(new char[] { character });
	}
	/**
	 * Checks whether a character to be inserted is already present at the insert location (perhaps
	 * separated by some whitespace from <code>position</code>.
	 * 
	 * @param document the document we are working on
	 * @param position the insert position of <code>ch</code>
	 * @param character the character to be inserted
	 * @return <code>true</code> if <code>ch</code> is already present at <code>location</code>, <code>false</code> otherwise
	 */
	private boolean alreadyPresent(IDocument document, char ch, int position) {
		int pos= firstNonWhitespaceForward(document, position, fPartitioning, document.getLength());
		try {
			if (pos != -1 && document.getChar(pos) == ch)
				return true;
		} catch (BadLocationException e) {
		}
		return false;
	}
	/**
	 * Computes the next insert position of the given character in the current line.
	 * 
	 * @param document the document we are working on
	 * @param line the line where the change is being made
	 * @param offset the position of the caret in the line when <code>character</code> was typed
	 * @param character the character to look for