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
if (position < 1)
			return false;
		position= firstNonWhitespaceBackward(document, position - 1, fPartitioning, bound);
		if (position < 1)
			return false;
		
		if (looksLike(document, position, "do") 
				|| looksLike(document, position, "else")) 
			return true;
			
		try {
			
			if (")".equals(document.get(position, 1))) { 
				position= findOpeningParenMatch(document, position, fPartitioning);
				if (position > 0) {
					position= firstNonWhitespaceBackward(document, position - 1, fPartitioning, -1);
					if (position != -1) {
						if (looksLike(document, position, "if") 
								|| looksLike(document, position, "for") 
								|| looksLike(document, position, "while")) 
							return true;
					}
				}
			}
		} catch (BadLocationException e) {
			
		}
		
		return false;
	}