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
}
		return position;
	}
	/**
	 * From <code>position</code> to the left, eats any whitespace and the first identifier, returning
	 * the position of the first identifier character (in normal read order).
	 * <p>When called on a document with content <code>" some string  "</code> and positionition 13, the
	 * return value will be 6 (the first letter in <code>string</code>).
	 * </p>
	 *
	 * @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 the smallest character position of an identifier or -1 if none can be found; always &lt;= <code>position</code>
	 */
	private static int eatIdentToLeft(IDocument document, int position, String partitioning) {
		if (position < 0)
			return -1;
		Assert.isTrue(position < document.getLength());
		int p= firstNonWhitespaceBackward(document, position, partitioning, -1);
		if (p == -1)
			return -1;
		try {
			while (p >= 0) {
				char ch= document.getChar(p);
				if (Character.isJavaIdentifierPart(ch)) {
					p--;
					continue;
				}