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
private boolean isSmartMode() {
		return fIsSmartMode;
	}
	
	private void clearCachedValues() {
		
		fTabWidth= CodeFormatterUtil.getTabWidth();
        
        IPreferenceStore preferenceStore= getPreferenceStore();
		fUseSpaces= preferenceStore.getBoolean(PreferenceConstants.EDITOR_SPACES_FOR_TABS);
		fCloseBrace= preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
		fIsSmartMode= computeSmartMode();
	}
	
	private boolean computeSmartMode() {
		IWorkbenchPage page= JavaPlugin.getActivePage();
		if (page != null)  {
			IEditorPart part= page.getActiveEditor(); 
			if (part instanceof ITextEditorExtension3) {
				ITextEditorExtension3 extension= (ITextEditorExtension3) part;
				return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
			}
		}
		return false;
	}
	private static int searchForClosingPeer(IDocument document, int position, String partitioning, final char openingPeer, final char closingPeer) {
		Assert.isTrue(position >= 0);
		try {
			int length= document.getLength();