Bug 40038 [typing] Smart semicolon fooled by method braces
Build: I20030710 Start writing a setter method, like this: public void setValue(int i) {} Then position cursor between the braces and fill in the method body. You end up with this: public void setValue(int i) {this.value=i}; Problem: when you type the semicolon, it jumps over the closing method body brace and places it at the end of the line, resulting in a syntax error.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/SmartSemicolonAutoEditStrategy.java
*/
	protected static int computeCharacterPosition(IDocument document, ITextSelection line, int offset, char character, String partitioning) {
		String text= line.getText();
		if (text == null)
			return 0;
		int insertPos;
		if (character == BRACECHAR) {
			insertPos= computeArrayInitializationPos(document, line, offset, partitioning);
			if (insertPos == -1) {
				insertPos= computeAfterTryDoElse(document, line, offset);
			}
			if (insertPos == -1) {
				insertPos= computeAfterParenthesis(document, line, offset, partitioning);
			}
		} else if (character == SEMICHAR) {
			if (isForStatement(text, offset)) {
				insertPos= -1; 
			} else {
				int nextPartitionPos= nextPartitionOrLineEnd(document, line, offset, partitioning);
				insertPos= startOfWhitespaceBeforeOffset(text, nextPartitionPos);
				
				if (insertPos > 0 && text.charAt(insertPos - 1) == character)
					insertPos= insertPos - 1;
			}
			
		} else {
			Assert.isTrue(false);
			return -1;
		}
		return insertPos;