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;
		if (fCharacter == BRACECHAR && !store.getBoolean(PreferenceConstants.EDITOR_SMART_OPENING_BRACE))
			return;
		IWorkbenchPage page= JavaPlugin.getActivePage();
		if (page == null)
			return;
		IEditorPart part= page.getActiveEditor();
		if (!(part instanceof CompilationUnitEditor))
			return;
		CompilationUnitEditor editor= (CompilationUnitEditor)part;
		if (editor.getInsertMode() != ITextEditorExtension3.SMART_INSERT || !editor.isEditable())
			return;
		ITextEditorExtension2 extension= (ITextEditorExtension2)editor.getAdapter(ITextEditorExtension2.class);
		if (extension != null && !extension.validateEditorInputState())
			return;
		if (isMultilineSelection(document, command))
			return;
		
		int pos= command.offset;
		ITextSelection line;
		try {
			IRegion l= document.getLineInformationOfOffset(pos);
			line= new TextSelection(document, l.getOffset(), l.getLength());
		} catch (BadLocationException e) {
			return;
		}
		
		
		int positionInLine= computeCharacterPosition(document, line, pos - line.getOffset(), fCharacter, fPartitioning);
		int position= positionInLine + line.getOffset();