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
fProblemPainter.paintAnnotations(annotationType, true);
		fProblemPainter.paint(IPainter.CONFIGURATION);
	}
	
	private void shutdownAnnotationIndication() {
		if (fProblemPainter != null) {
			
			if (!fProblemPainter.isPaintingAnnotations()) {
				fPaintManager.removePainter(fProblemPainter);
				fProblemPainter.deactivate(true);
				fProblemPainter.dispose();
				fProblemPainter= null;
			} else {
				fProblemPainter.paint(IPainter.CONFIGURATION);
			}
		}
	}
	private void stopAnnotationIndication(AnnotationType annotationType) {
		if (fProblemPainter != null) {
			fProblemPainter.paintAnnotations(annotationType, false);
			shutdownAnnotationIndication();
		}
	}
	
	private boolean isAnnotationIndicationEnabled(AnnotationType annotationType) {
		IPreferenceStore store= getPreferenceStore();
		AnnotationInfo info= (AnnotationInfo) ANNOTATION_MAP.get(annotationType);
		if (info != null)
			return store.getBoolean(info.fEditorPreference);
		return false;