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
*
	 * @param doc 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")) 
					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>