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
if (looksLike(doc, p, "try") 
				|| looksLike(doc, p, "do")  
				|| looksLike(doc, p, "synchronized")  
				|| looksLike(doc, p, "static")  
				|| looksLike(doc, p, "finally")  
				|| looksLike(doc, p, "else"))  
			return p + 1 - line.getOffset();
		return -1;
	}
	/**
	 * Computes an insert position for an opening brace if <code>offset</code> maps to a position in
	 * <code>document</code> with a expression in parenthesis that will take a block after the closing parenthesis.
	 * 
	 * @param document the document being modified
	 * @param line the current line under investigation
	 * @param offset the offset of the caret position, relative to the line start.
	 * @param partitioning the document partitioning
	 * @return an insert position relative to the line start if <code>line</code> contains a parenthesized expression that can be followed by a block, -1 otherwise
	 */
	private static int computeAfterParenthesis(IDocument document, ITextSelection line, int offset, String partitioning) {
		
		
		
		int pos= offset + line.getOffset();
		int length= line.getOffset() + line.getLength();
		int scanTo= scanForward(document, pos, partitioning, length, '}');
		if (scanTo == -1)
			scanTo= length;
			
		int closingParen= findClosingParenToLeft(document, pos, partitioning) - 1;