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
public String fColorPreference;
		public String fOverviewRulerPreference;
		public String fEditorPreference;
	};
	
	private final static Map ANNOTATION_MAP;
	static {
		
		AnnotationInfo info;
		ANNOTATION_MAP= new HashMap();
		info= new AnnotationInfo();
		info.fColorPreference= TASK_INDICATION_COLOR;
		info.fOverviewRulerPreference= TASK_INDICATION_IN_OVERVIEW_RULER;
		info.fEditorPreference= TASK_INDICATION;
		ANNOTATION_MAP.put(AnnotationType.TASK, info);
		
		info= new AnnotationInfo();
		info.fColorPreference= ERROR_INDICATION_COLOR;
		info.fOverviewRulerPreference= ERROR_INDICATION_IN_OVERVIEW_RULER;