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
}
			
			int offset= command.offset;
			int line= document.getLineOfOffset(offset);
			int lineOffset= document.getLineOffset(line);
			String prefix= document.get(lineOffset, offset - lineOffset);
			boolean formatFirstLine= prefix.trim().length() == 0;
			String formattedParagraph= format(pastedText, newIndentSize, lineDelimiter, formatFirstLine);
			
			if (formatFirstLine) {
				int end= command.offset + command.length;
				command.offset= lineOffset;
				command.length= end - command.offset;
			}
			command.text= formattedParagraph;
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		}
	}
	private static String getIndentOfLine(String line) {
		int i= 0;
		for (; i < line.length(); i++) {
			if (! Character.isWhitespace(line.charAt(i)))
				break;
		}
		return line.substring(0, i);
	}
	/**
	 * Returns the indent of the first non empty line.
	 * A line is considered empty if it only consists of whitespaces or if it