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
command.length= 0;
			command.caretOffset= position;
			command.text= insertion;
			command.doit= true;
			command.owner= null;
		} catch (MalformedTreeException e) {
			JavaPlugin.log(e);
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	}
	/**
	 * Returns <code>true</code> if the document command is applied on a multi
	 * line selection, <code>false</code> otherwise.
	 *
	 * @param document the document
	 * @param command the command
	 * @return <code>true</code> if <code>command</code> is a multiline command
	 */
	private boolean isMultilineSelection(IDocument document, DocumentCommand command) {
		try {
			return document.getNumberOfLines(command.offset, command.length) > 1;
		} catch (BadLocationException e) {
			
			return false;
		}
	}
	/**
	 * Adds a space before a brace if it is inserted after a parenthesis, equal sign, or one
	 * of the keywords <code>try, else, do</code>.