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
AnnotationInfo info= (AnnotationInfo) ANNOTATION_MAP.get(type);
					if (info.fColorPreference.equals(p)) {
						Color color= getColor(type);
						if (fProblemPainter != null) {
							fProblemPainter.setColor(type, color);
							fProblemPainter.paint(IPainter.CONFIGURATION);
						}
						setColorInOverviewRuler(type, color);
						return;
					}
					
					if (info.fEditorPreference.equals(p)) {
						if (isAnnotationIndicationEnabled(type))
							startAnnotationIndication(type);
						else
							stopAnnotationIndication(type);
						return;
					}
					
					if (info.fOverviewRulerPreference.equals(p)) {
						if (isAnnotationIndicationInOverviewRulerEnabled(type))
							showAnnotationIndicationInOverviewRuler(type, true);
						else
							showAnnotationIndicationInOverviewRuler(type, false);
						return;
					}
				}
				IContentAssistant c= asv.getContentAssistant();
				if (c instanceof ContentAssistant)