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
}
	/**
	 * Computes an insert position for an opening brace if <code>offset</code> maps to a position in
	 * <code>document</code> that looks like being the RHS of an assignment or like an array definition.
	 * 
	 * @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> looks like being an array initialization at <code>offset</code>, -1 otherwise
	 */
	private static int computeArrayInitializationPos(IDocument document, ITextSelection line, int offset, String partitioning) {
		
		int pos= offset + line.getOffset();
		if (pos == 0)
			return -1;
			
		int p= firstNonWhitespaceBackward(document, pos - 1, partitioning, -1);
		
		if (p == -1)
			return -1;
			
		try {
				
			char ch= document.getChar(p);
			if (ch != '=' && ch != ']')
				return -1;
			
			if (p == 0)
				return offset;