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
* Computes an insert position for an opening brace if <code>offset</code> maps to a position in
	 * <code>document</code> with a expression in parenthesis that will take a block after the closing parenthesis.
	 *
	 * @param document the document being modified
	 * @param line the current line under investigation
	 * @param offset the offset of the caret position, relative to the line start.
	 * @param partitioning the document partitioning
	 * @return an insert position relative to the line start if <code>line</code> contains a parenthesized expression that can be followed by a block, -1 otherwise
	 */
	private static int computeAfterParenthesis(IDocument document, ITextSelection line, int offset, String partitioning) {
		
		
		
		int pos= offset + line.getOffset();
		int length= line.getOffset() + line.getLength();
		int scanTo= scanForward(document, pos, partitioning, length, '}');
		if (scanTo == -1)
			scanTo= length;
		int closingParen= findClosingParenToLeft(document, pos, partitioning) - 1;
		while (true) {
			int startScan= closingParen + 1;
			closingParen= scanForward(document, startScan, partitioning, scanTo, ')');
			if (closingParen == -1)
				break;
			int openingParen= findOpeningParenMatch(document, closingParen, partitioning);
			
			if (openingParen < 1)
				break;
			
			if (openingParen > pos)