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
buf.append(d.get(start, length));
						buf.append('}');
					}
				} else if (isBracelessBlockStart(d, c.offset, start)) {
					buf.append(createIndent(1, useSpaces()));
				}
			}
			c.text= buf.toString();
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	}
	/**
	 * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while, 
	 * or for statement with just one following statement, see example below). 
	 * 
	 * <pre>
	 * if (condition)
	 *     doStuff();
	 * </pre>
	 * 
	 * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),
	 * for( expression), do, else, and there is no statement after that </p> 
	 * 
	 * @param document the document worked on
	 * @param position the insert position of the new character
	 * @param bound the lowest position to consider
	 * @return <code>true</code> if the code is a conditional statement or loop without a block, <code>false</code> otherwise
	 */
	private boolean isBracelessBlockStart(IDocument document, int position, int bound) {