Buggy code:
public class KeysPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private static final class CommandAssignment implements Comparable { private Assignment assignment ; private String contextId ; private KeySequence keySequence ; public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } } private static final class KeySequenceAssignment implements Comparable { private Assignment assignment ; private String contextId ; public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } } private static final int DIFFERENCE_ADD = 0 ; private static final int DIFFERENCE_CHANGE = 1 ; private static final int DIFFERENCE_MINUS = 2 ; private static final int DIFFERENCE_NONE = 3 ; private static final Image IMAGE_BLANK = ImageFactory . getImage ( "blank" ) ; private static final Image IMAGE_CHANGE = ImageFactory . getImage ( "change" ) ; private static final Image IMAGE_MINUS = ImageFactory . getImage ( "minus" ) ; private static final Image IMAGE_PLUS = ImageFactory . getImage ( "plus" ) ; private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( KeysPreferencePage . class . getName ( ) ) ; private static final RGB RGB_MINUS = new RGB ( 160 , 160 , 160 ) ; private Map assignmentsByContextIdByKeySequence ; private Button buttonAdd ; private Button buttonAddKey ; private Button buttonRemove ; private Button buttonRestore ; private Map categoryIdsByUniqueName ; private Map categoryUniqueNamesById ; private Button checkBoxMultiKeyAssist ; private Combo comboCategory ; private Combo comboCommand ; private Combo comboContext ; private Combo comboKeyConfiguration ; private Set commandAssignments ; private Map commandIdsByCategoryId ; private Map commandIdsByUniqueName ; private CommandManager commandManager ; private Map commandUniqueNamesById ; private Map contextIdsByCommandId ; private Map contextIdsByUniqueName ; private IContextManager contextManager ; private Map contextUniqueNamesById ; private Group groupCommand ; private Group groupKeySequence ; private Map keyConfigurationIdsByUniqueName ; private Map keyConfigurationUniqueNamesById ; private Set keySequenceAssignments ; private Label labelAssignmentsForCommand ; private Label labelAssignmentsForKeySequence ; private Label labelCategory ; private Label labelCommand ; private Label labelContext ; private Label labelContextExtends ; private Label labelKeyConfiguration ; private Label labelKeyConfigurationExtends ; private Label labelKeySequence ; private Menu menuButtonAddKey ; private Table tableAssignmentsForCommand ; private Table tableAssignmentsForKeySequence ; private Text textKeySequence ; private KeySequenceText textKeySequenceManager ; private IntegerFieldEditor textMultiKeyAssistTime ; private SortedMap tree ; private void buildCommandAssignmentsTable ( ) { } private void buildKeySequenceAssignmentsTable ( ) { } private Composite createAdvancedTab ( TabFolder parent ) { } private Composite createBasicTab ( TabFolder parent ) { } protected Control createContents ( Composite parent ) { } protected IPreferenceStore doGetPreferenceStore ( ) { } private void doubleClickedAssignmentsForCommand ( ) { } private void doubleClickedTableAssignmentsForKeySequence ( ) { } private String getCategoryId ( ) { } private String getCommandId ( ) { } private String getContextId ( ) { } private String getKeyConfigurationId ( ) { } private KeySequence getKeySequence ( ) { } public void init ( IWorkbench workbench ) { IWorkbenchContextSupport workbenchContextSupport = workbench . getContextSupport ( ) ; contextManager = workbenchContextSupport . getContextManager ( ) ; <START_BUG> commandManager = ( ( CommandManager ) ( workbench . getCommandManager ( ) ) ) ; <END_BUG> commandAssignments = new TreeSet ( ) ; keySequenceAssignments = new TreeSet ( ) ; } private void modifiedTextKeySequence ( ) { } protected void performDefaults ( ) { } public boolean performOk ( ) { } private void selectAssignmentForCommand ( String contextId ) { } private void selectAssignmentForKeySequence ( String contextId ) { } private void selectedButtonAdd ( ) { } private void selectedButtonRemove ( ) { } private void selectedButtonRestore ( ) { } private void selectedComboCategory ( ) { } private void selectedComboCommand ( ) { } private void selectedComboContext ( ) { } private void selectedComboKeyConfiguration ( ) { } private void selectedTableAssignmentsForCommand ( ) { } private void selectedTableAssignmentsForKeySequence ( ) { } private void setAssignmentsForCommand ( ) { } private void setAssignmentsForKeySequence ( ) { } private void setCommandId ( String commandId ) { } private void setCommandsForCategory ( ) { } private void setContextId ( String contextId ) { } private void setContextsForCommand ( ) { } private void setKeyConfigurationId ( String keyConfigurationId ) { } private void setKeySequence ( KeySequence keySequence ) { } public void setVisible ( boolean visible ) { } private void update ( ) { } private void updateLabelContextExtends ( ) { } private void updateLabelKeyConfigurationExtends ( ) { } }

Fix:
commandManager = ( ( CommandManager ) ( workbench . getCommandSupport ( ) . getCommandManager ( ) ) ) ;