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 -1;
	}
	/**
	 * Computes an insert position for an opening brace if <code>offset</code> maps to a position in
	 * <code>doc</code> involving a keyword taking a block after it. These are: <code>try</code>,
	 * <code>do</code>, <code>synchronized</code>, <code>static</code>, <code>finally</code>, or <code>else</code>.
	 *
	 * @param doc the document being modified
	 * @param line the current line under investigation
	 * @param offset the offset of the caret position, relative to the line start.
	 * @return an insert position  relative to the line start if <code>line</code> contains one of the above keywords at or before <code>offset</code>, -1 otherwise
	 */
	private static int computeAfterTryDoElse(IDocument doc, ITextSelection line, int offset) {
		
		int p= offset + line.getOffset();
		p= firstWhitespaceToRight(doc, p);
		if (p == -1)
			return -1;
		p--;
		if (looksLike(doc, p, "try") 
				|| looksLike(doc, p, "do")  
				|| looksLike(doc, p, "synchronized")  
				|| looksLike(doc, p, "static")  
				|| looksLike(doc, p, "finally")  
				|| looksLike(doc, p, "else"))  
			return p + 1 - line.getOffset();
		return -1;
	}
	/**