Bug 41906 [typing] Code assists handles anonymous inner classes less than optimal
Type the following code and press return at the indicated cursor position. addActionListener(new ActionListener() { <<<cursor_position>>> ) You get the following code: addActionListener(new ActionListener() { ) } The normal brace and the curly brace should really be exchanged.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
/**
	 * Creates a new Java auto indent strategy for the given document partitioning.
	 * 
	 * @param partitioning the document partitioning
	 */
	public JavaAutoIndentStrategy(String partitioning) {
		fPartitioning= partitioning;
 	}
	/**
	 * Evaluates the given line for the opening bracket that matches the closing bracket on the given line.
	 */
	private int findMatchingOpenBracket(IDocument d, int lineNumber, int endOffset, int closingBracketIncrease) throws BadLocationException {
		int startOffset= d.getLineOffset(lineNumber);
		int bracketCount= getBracketCount(d, startOffset, endOffset, false) - closingBracketIncrease;
		
		
		while (bracketCount < 0) {
			--lineNumber;
			if (lineNumber < 0)
				return -1;
			startOffset= d.getLineOffset(lineNumber);
			endOffset= startOffset + d.getLineLength(lineNumber) - 1;
			bracketCount += getBracketCount(d, startOffset, endOffset, false);
		}
		return lineNumber;
	}
	private int getBracketCount(IDocument d, int startOffset, int endOffset, boolean ignoreCloseBrackets) throws BadLocationException {
		int bracketCount= 0;
		while (startOffset < endOffset) {