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.text.tests/src/org/eclipse/jdt/text/tests/SmartSemicolonAutoEditStrategyTest.java
public static int computeCharacterPosition(IDocument document, ITextSelection line, int offset, char character, String partitioning) {
			return SmartSemicolonAutoEditStrategy.computeCharacterPosition(document, line, offset, character, partitioning);
		}
	}
	
	public static Test suite() {
		return new TestSuite(SmartSemicolonAutoEditStrategyTest.class);
	}
	
	private FastPartitioner fPartitioner;
	private static final char SEMI= ';';
	private static final char BRACE= '{';
	private Document fDocument;
	public SmartSemicolonAutoEditStrategyTest() {
		fDocument= new Document();
		String[] types= new String[] {
			IJavaPartitions.JAVA_DOC,
			IJavaPartitions.JAVA_MULTI_LINE_COMMENT,
			IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
			IJavaPartitions.JAVA_STRING,
			IJavaPartitions.JAVA_CHARACTER,
			IDocument.DEFAULT_CONTENT_TYPE
		};
		fPartitioner= new FastPartitioner(new FastJavaPartitionScanner(), types);
		fPartitioner.connect(fDocument); 
		fDocument.setDocumentPartitioner(IJavaPartitions.JAVA_PARTITIONING, fPartitioner); 
	}
	private void verifySemicolonPosition(int caret, int expected) throws BadLocationException {
		IRegion region= fDocument.getLineInformation(0);
		ITextSelection selection= new TextSelection(fDocument, region.getOffset(), region.getLength());