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
if (MATCHING_BRACKETS.equals(p)) {
					if (isBracketHighlightingEnabled())
						startBracketHighlighting();
					else
						stopBracketHighlighting();
					return;
				}
				
				if (MATCHING_BRACKETS_COLOR.equals(p)) {
					if (fBracketPainter != null)
						fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR));
					return;
				}
				
				if (CURRENT_LINE.equals(p)) {
					if (isLineHighlightingEnabled())
						startLineHighlighting();
					else
						stopLineHighlighting();
					return;
				}
				
				if (CURRENT_LINE_COLOR.equals(p)) {
					if (fLinePainter != null) {
						stopLineHighlighting();
						startLineHighlighting();
					}					
					return;
				}