Bug 21047 code formatter availability inconsistent
Sometimes the hotkey (ctrl-shift-f) and the menu entry for formatting the source code are disabled, while the entry in the context menu is enabled and works as expected. I didn't find any patterns on when this occurs till now.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
info.fEditorPreference= ERROR_INDICATION;
		ANNOTATION_MAP.put(AnnotationType.ERROR, info);
		
		info= new AnnotationInfo();
		info.fColorPreference= WARNING_INDICATION_COLOR;
		info.fOverviewRulerPreference= WARNING_INDICATION_IN_OVERVIEW_RULER;
		info.fEditorPreference= WARNING_INDICATION;
		ANNOTATION_MAP.put(AnnotationType.WARNING, info);
		
		info= new AnnotationInfo();
		info.fColorPreference= BOOKMARK_INDICATION_COLOR;
		info.fOverviewRulerPreference=  BOOKMARK_INDICATION_IN_OVERVIEW_RULER;
		info.fEditorPreference=  BOOKMARK_INDICATION;
		ANNOTATION_MAP.put(AnnotationType.BOOKMARK, info);
		
		info= new AnnotationInfo();
		info.fColorPreference= SEARCH_RESULT_INDICATION_COLOR;
		info.fOverviewRulerPreference=  SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER;
		info.fEditorPreference=  SEARCH_RESULT_INDICATION;
		ANNOTATION_MAP.put(AnnotationType.SEARCH_RESULT, info);
		
		info= new AnnotationInfo();
		info.fColorPreference= UNKNOWN_INDICATION_COLOR;
		info.fOverviewRulerPreference=  UNKNOWN_INDICATION_IN_OVERVIEW_RULER;
		info.fEditorPreference=  UNKNOWN_INDICATION;
		ANNOTATION_MAP.put(AnnotationType.UNKNOWN, info);
	};
	
	private final static AnnotationType[] ANNOTATION_LAYERS= new AnnotationType[] {
		AnnotationType.UNKNOWN,