Buggy code:
public final class CommandManager implements ICommandManager { public static final String SEPARATOR = "_" ; static String [ ] extend ( String [ ] strings ) { } static String [ ] getPath ( String string , String separator ) { } static boolean isKeyConfigurationDefinitionChildOf ( String ancestor , String id , Map keyConfigurationDefinitionsById ) { } static void validateActivityBindingDefinitions ( Collection activityBindingDefinitions ) { } static void validateImageBindingDefinitions ( Collection imageBindingDefinitions ) { } static boolean validateKeySequence ( KeySequence keySequence ) { } static void validateKeySequenceBindingDefinitions ( Collection keySequenceBindingDefinitions ) { } private Map actionsById = new HashMap ( ) ; private Set activeActivityIds = new HashSet ( ) ; private String activeKeyConfigurationId = null ; private String activeLocale = null ; private String activePlatform = null ; private Map activityBindingsByCommandId = new HashMap ( ) ; private Map categoriesById = new WeakHashMap ( ) ; private Set categoriesWithListeners = new HashSet ( ) ; private Map categoryDefinitionsById = new HashMap ( ) ; private Map commandDefinitionsById = new HashMap ( ) ; private Map commandIdsByActionIds = new HashMap ( ) ; private List commandManagerListeners ; private ICommandRegistry commandRegistry ; private Map commandsById = new WeakHashMap ( ) ; private Set commandsWithListeners = new HashSet ( ) ; private Set definedCategoryIds = new HashSet ( ) ; private Set definedCommandIds = new HashSet ( ) ; private Set definedKeyConfigurationIds = new HashSet ( ) ; private Map imageBindingsByCommandId = new HashMap ( ) ; private Map keyConfigurationDefinitionsById = new HashMap ( ) ; private Map keyConfigurationsById = new WeakHashMap ( ) ; private Set keyConfigurationsWithListeners = new HashSet ( ) ; private KeySequenceBindingMachine keySequenceBindingMachine = new KeySequenceBindingMachine ( ) ; private Map keySequenceBindingsByCommandId = new HashMap ( ) ; private IMutableCommandRegistry mutableCommandRegistry ; public CommandManager ( ) { } public CommandManager ( ICommandRegistry commandRegistry , IMutableCommandRegistry mutableCommandRegistry ) { } public void addCommandManagerListener ( ICommandManagerListener commandManagerListener ) { } private void calculateImageBindings ( ) { } private void calculateKeySequenceBindings ( ) { } private void fireCommandManagerChanged ( CommandManagerEvent commandManagerEvent ) { } public Map getActionsById ( ) { } public Set getActiveActivityIds ( ) { } public String getActiveKeyConfigurationId ( ) { } public String getActiveLocale ( ) { } public String getActivePlatform ( ) { } public ICategory getCategory ( String categoryId ) { } public ICommand getCommand ( String commandId ) { } public ICommandRegistry getCommandRegistry ( ) { } public Set getDefinedCategoryIds ( ) { } public Set getDefinedCommandIds ( ) { } public Set getDefinedKeyConfigurationIds ( ) { } public IKeyConfiguration getKeyConfiguration ( String keyConfigurationId ) { } String [ ] getKeyConfigurationIds ( String keyConfigurationId ) { } IMutableCommandRegistry getMutableCommandRegistry ( ) { } public Map getPartialMatches ( KeySequence keySequence ) { } public String getPerfectMatch ( KeySequence keySequence ) { } private boolean isActive ( Collection activityBindings ) { } public boolean isPartialMatch ( KeySequence keySequence ) { } public boolean isPerfectMatch ( KeySequence keySequence ) { } private void notifyCategories ( Map categoryEventsByCategoryId ) { } private void notifyCommands ( Map commandEventsByCommandId ) { } private void notifyKeyConfigurations ( Map keyConfigurationEventsByKeyConfigurationId ) { } private void readRegistry ( ) { } public void removeCommandManagerListener ( ICommandManagerListener commandManagerListener ) { } public void setActionsById ( Map actionsById ) { <START_BUG> actionsById = Util . safeCopy ( actionsById , String . class , IHandler . class ) ; <END_BUG> if ( ! ( Util . equals ( actionsById , this . actionsById ) ) ) { this . actionsById = actionsById ; for ( Iterator iterator = this . actionsById . entrySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { Map . Entry entry = ( ( Map . Entry ) ( iterator . next ( ) ) ) ; String commandId = ( ( String ) ( entry . getKey ( ) ) ) ; IHandler action = ( ( IHandler ) ( entry . getValue ( ) ) ) ; if ( ( commandId != null ) && ( action instanceof ActionHandler ) ) { ActionHandler actionHandler = ( ( ActionHandler ) ( action ) ) ; IAction jfaceAction = ( ( IAction ) ( actionHandler . getAction ( ) ) ) ; if ( jfaceAction != null ) { String actionId = jfaceAction . getId ( ) ; if ( actionId != null ) commandIdsByActionIds . put ( actionId , commandId ) ; } } } } } public void setActiveActivityIds ( Set activeActivityIds ) { } public void setActiveKeyConfigurationId ( String activeKeyConfigurationId ) { } public void setActiveLocale ( String activeLocale ) { } public void setActivePlatform ( String activePlatform ) { } private Map updateCategories ( Collection categoryIds ) { } private CategoryEvent updateCategory ( Category category ) { } private CommandEvent updateCommand ( Command command ) { } private Map updateCommands ( Collection commandIds ) { } private KeyConfigurationEvent updateKeyConfiguration ( KeyConfiguration keyConfiguration ) { } private Map updateKeyConfigurations ( Collection keyConfigurationIds ) { } }

Fix:
actionsById = Util . safeCopy ( actionsById , String . class , IHandler . class , false , true ) ;