Buggy code:
private static CommandManager instance ; public static CommandManager getInstance ( ) { } public static void validateCategoryDefinitions ( Collection categoryDefinitions ) { } public static void validateCommandDefinitions ( Collection commandDefinitions ) { } public static void validateContextBindingDefinitions ( Collection contextBindingDefinitions ) { } public static void validateImageBindingDefinitions ( Collection imageBindingDefinitions ) { } public static void validateKeyBindingDefinitions ( Collection keyBindingDefinitions ) { } public static void validateKeyConfigurationDefinitions ( Collection keyConfigurationDefinitions ) { } public static boolean validateKeySequence ( KeySequence keySequence ) { } public static boolean validateKeyStroke ( KeyStroke keyStroke ) { } private Map actionsById = new HashMap ( ) ; private List activeContextIds = Collections . EMPTY_LIST ; private Set activeContextIdsAsSet = new HashSet ( ) ; private String activeKeyConfigurationId = null ; private String activeLocale = null ; private String activePlatform = null ; private SortedMap categoriesById = new TreeMap ( ) ; private SortedMap categoryDefinitionsById = new TreeMap ( ) ; private SortedMap commandDefinitionsById = new TreeMap ( ) ; private ICommandManagerEvent commandManagerEvent ; private List commandManagerListeners ; private SortedMap commandsById = new TreeMap ( ) ; private SortedMap contextBindingsByCommandId = new TreeMap ( ) ; private SortedSet definedCategoryIds = new TreeSet ( ) ; private SortedSet definedCommandIds = new TreeSet ( ) ; private SortedSet definedKeyConfigurationIds = new TreeSet ( ) ; private Map imageBindingsByCommandId = new TreeMap ( ) ; private Map keyBindingsByCommandId = new TreeMap ( ) ; private KeyBindingMachine keyBindingMachine = new KeyBindingMachine ( ) ; private SortedMap keyConfigurationDefinitionsById = new TreeMap ( ) ; private SortedMap keyConfigurationsById = new TreeMap ( ) ; private PluginCommandRegistry pluginCommandRegistry ; private SortedSet pluginContextBindingDefinitions = Util . EMPTY_SORTED_SET ; private SortedSet pluginImageBindingDefinitions = Util . EMPTY_SORTED_SET ; private SortedSet pluginKeyBindingDefinitions = Util . EMPTY_SORTED_SET ; private PreferenceCommandRegistry preferenceCommandRegistry ; private SortedSet preferenceContextBindingDefinitions = Util . EMPTY_SORTED_SET ; private SortedSet preferenceImageBindingDefinitions = Util . EMPTY_SORTED_SET ; private SortedSet preferenceKeyBindingDefinitions = Util . EMPTY_SORTED_SET ; private CommandManager ( ) { } public void addCommandManagerListener ( ICommandManagerListener commandManagerListener ) { } public Map getActionsById ( ) { } public List getActiveContextIds ( ) { } public String getActiveKeyConfigurationId ( ) { } public String getActiveLocale ( ) { } public String getActivePlatform ( ) { } public ICategory getCategory ( String categoryId ) { } public ICommand getCommand ( String commandId ) { } public SortedSet getDefinedCategoryIds ( ) { } public SortedSet getDefinedCommandIds ( ) { } public SortedSet getDefinedKeyConfigurationIds ( ) { } public IKeyConfiguration getKeyConfiguration ( String keyConfigurationId ) { } public Map getKeyBindingsByCommandId ( ) { } public Map getKeyBindingsByCommandIdForMode ( ) { } public Map getMatchesByKeySequence ( ) { } public Map getMatchesByKeySequenceForMode ( ) { } public KeySequence getMode ( ) { } public boolean setMode ( KeySequence mode ) { } public String getKeyTextForCommand ( String commandId ) { } public void reset ( ) { } public void removeCommandManagerListener ( ICommandManagerListener commandManagerListener ) { } public void setActionsById ( Map actionsById ) { } public void setActiveContextIds ( List activeContextIds ) { } public void setActiveLocale ( String activeLocale ) { } public void setActivePlatform ( String activePlatform ) { } private void calculateContextBindings ( ) { } private void calculateImageBindings ( ) { } private void calculateKeyBindings ( ) { } private String [ ] extend ( String [ ] strings ) { } private void fireCommandManagerChanged ( ) { } private static String [ ] getKeyConfigurationIds ( String keyConfigurationDefinitionId , Map keyConfigurationDefinitionsById ) { } private static String [ ] getPath ( String string , String separator ) { } public ICommandRegistry getPluginCommandRegistry ( ) { } public ICommandRegistry getPreferenceCommandRegistry ( ) { } private boolean inContext ( Collection contextBindings ) { } private void loadPluginCommandRegistry ( ) { } private void loadPreferenceCommandRegistry ( ) { } private void notifyCategories ( Collection categoryIds ) { } private void notifyCommands ( Collection commandIds ) { } private void notifyKeyConfigurations ( Collection keyConfigurationIds ) { } private void readRegistry ( ) { } private SortedSet updateCategories ( Collection categoryIds ) { } private boolean updateCategory ( Category category ) { } private boolean updateCommand ( Command command ) { boolean updated = false ; SortedSet contextBindings = ( ( SortedSet ) ( contextBindingsByCommandId . get ( command . getId ( ) ) ) ) ; <START_BUG> updated |= command . setActive ( ( contextBindings != null ? inContext ( contextBindings ) : false ) ) ; <END_BUG> ICommandDefinition commandDefinition = ( ( ICommandDefinition ) ( commandDefinitionsById . get ( command . getId ( ) ) ) ) ; updated |= command . setCategoryId ( ( commandDefinition != null ? commandDefinition . getCategoryId ( ) : null ) ) ; updated |= command . setContextBindings ( ( contextBindings != null ? contextBindings : Util . EMPTY_SORTED_SET ) ) ; updated |= command . setDefined ( ( commandDefinition != null ) ) ; updated |= command . setDescription ( ( commandDefinition != null ? commandDefinition . getDescription ( ) : null ) ) ; updated |= command . setHelpId ( ( commandDefinition != null ? commandDefinition . getHelpId ( ) : null ) ) ; SortedSet imageBindings = ( ( SortedSet ) ( imageBindingsByCommandId . get ( command . getId ( ) ) ) ) ; updated |= command . setImageBindings ( ( imageBindings != null ? imageBindings : Util . EMPTY_SORTED_SET ) ) ; SortedSet keyBindings = ( ( SortedSet ) ( keyBindingsByCommandId . get ( command . getId ( ) ) ) ) ; updated |= command . setKeyBindings ( ( keyBindings != null ? keyBindings : Util . EMPTY_SORTED_SET ) ) ; updated |= command . setName ( ( commandDefinition != null ? commandDefinition . getName ( ) : null ) ) ; return updated ; } private SortedSet updateCommands ( Collection commandIds ) { } private boolean updateKeyConfiguration ( KeyConfiguration keyConfiguration ) { } private SortedSet updateKeyConfigurations ( Collection keyConfigurationIds ) { } }

Fix:
updated |= command . setActive ( ( contextBindings != null ? inContext ( contextBindings ) : true ) ) ;