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
int pos= SmartSemicolon.computeCharacterPosition(fDocument, selection, caret, SEMI, IJavaPartitions.JAVA_PARTITIONING);
		Assert.assertEquals(expected, pos);
	}
	
	private void verifyBracePosition(int caret, int expected) throws BadLocationException {
		IRegion region= fDocument.getLineInformation(0);
		ITextSelection selection= new TextSelection(fDocument, region.getOffset(), region.getLength());
		int pos= SmartSemicolon.computeCharacterPosition(fDocument, selection, caret, BRACE, IJavaPartitions.JAVA_PARTITIONING);
		if (pos == -1) pos= caret;
		Assert.assertEquals(expected, pos);
	}
	
	
	
	public void testGoToEOL() throws BadLocationException {
		fDocument.set("public void foobar()");
		verifySemicolonPosition(5, 20);
	}
	
	public void testGoToExisting() throws BadLocationException {
		if (true) {
			System.out.println("testGoToExisting disabled - unwanted functionality");
			return;
		}
		fDocument.set("public void; foobar()");
		verifySemicolonPosition(5, 11);
	}
	
	public void testFor() throws BadLocationException {
		fDocument.set("for (int i= 0)");