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(getIndentOfLine(d, indLine));
			} else {
				int start= d.getLineOffset(line);
				ITypedRegion region= TextUtilities.getPartition(d, fPartitioning, start);
				if (IJavaPartitions.JAVA_DOC.equals(region.getType()))
					start= d.getLineInformationOfOffset(region.getOffset()).getOffset();
				int whiteend= findEndOfWhiteSpace(d, start, c.offset);
				int length= whiteend - start;
				buf.append(d.get(start, length));
				if (getBracketCount(d, start, c.offset, true) > 0) {
					
					buf.append(createIndent(1, useSpaces()));
					
					if (fHasTypedBrace && closeBrace() && !isClosed(d, c.offset, c.length)) {
						c.caretOffset= c.offset + buf.length();
						c.shiftsCaret= false;
						
						
						
						IRegion reg= d.getLineInformation(line);
						int lineEnd= reg.getOffset() + reg.getLength();
						if (!(computeAnonymousPosition(d, c.offset - 1, fPartitioning, lineEnd) != -1)) {
							int contentStart= findEndOfWhiteSpace(d, c.offset, lineEnd);
							if (lineEnd - contentStart > 0) {
								c.length=  lineEnd - c.offset;
								buf.append(d.get(contentStart, lineEnd - contentStart).toCharArray());
							}
						}
					
						buf.append(getLineDelimiter(d));