Bug 108312 [typing] Smart semicolong option should support anonymizing a class
1) Place the caret between the closing parenthesis ')' and semicolon ';'. 2) Type an open brace '{'. 3) Type Enter key (carriage return). See that closing brace '}' is automatically added, but semicolon ';' is illegally misplaced. ----------------- Bug.java ------------------------ class Bug { Object object=new Object(); }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
}
	/**
	 * Finds the first whitespace character position to the right of (and including) <code>position</code>.
	 *
	 * @param document the document being modified
	 * @param position the first character position in <code>document</code> to be considered
	 * @return the position of a whitespace character greater or equal than <code>position</code> separated only by whitespace, or -1 if none found
	 */
	private static int firstWhitespaceToRight(IDocument document, int position) {
		int length= document.getLength();
		Assert.isTrue(position >= 0);
		Assert.isTrue(position <= length);
		try {
			while (position < length) {
				char ch= document.getChar(position);
				if (Character.isWhitespace(ch))
					return position;
				position++;
			}
			return position;
		} catch (BadLocationException e) {
		}
		return -1;
	}
	/**
	 * Finds the highest position in <code>document</code> such that the position is &lt;= <code>position</code>
	 * and &gt; <code>bound</code> and <code>Character.isWhitespace(document.getChar(pos))</code> evaluates to <code>false</code>
	 * and the position is in the default partition.
	 *
	 * @param document the document being modified