Program: 44855
Project: 44855
Buggy source:
/** 
 * Parses the keystrokes defined in the given attribute map (if any) and associates them with the given action id. The keystroke will not be associated in any of the following cases: <ul> <li>the keystrokes attributes do not contain any value.</li> <li>the keystrokes attributes have values that do not represent a valid KeyStroke (syntax error).</li> </ul> If a given keystroke is already associated to an action, the existing association is replaced.  If there is a valid alternative keystroke defined but there is no valid primary keystroke defined, the primary keystroke  is replaced by the alternative keystroke.
 * @param actionId the action id to associate the keystroke with
 * @param attributes the attributes map that holds the value
 */
private void processKeystrokeAttribute(String actionId,Attributes attributes){
  String keyStrokeString;
  KeyStroke alternateKeyStroke=null;
  KeyStroke primaryKeyStroke=null;
  keyStrokeString=attributes.getValue(PRIMARY_KEYSTROKE_ATTRIBUTE);
  if (keyStrokeString != null) {
    primaryKeyStroke=KeyStroke.getKeyStroke(keyStrokeString);
    if (primaryKeyStroke == null)     AppLogger.info("String_Node_Str" + keyStrokeString);
 else {
      String prevAssignedActionId=ActionKeymap.getRegisteredActionIdForKeystroke(primaryKeyStroke);
      if (prevAssignedActionId != null && !prevAssignedActionId.equals(actionId))       AppLogger.fine("String_Node_Str" + keyStrokeString + "String_Node_Str"+ actionId);
    }
  }
  keyStrokeString=attributes.getValue(ALTERNATE_KEYSTROKE_ATTRIBUTE);
  if (keyStrokeString != null) {
    alternateKeyStroke=KeyStroke.getKeyStroke(keyStrokeString);
    if (alternateKeyStroke == null)     AppLogger.info("String_Node_Str" + keyStrokeString);
 else {
      String prevAssignedActionId=ActionKeymap.getRegisteredActionIdForKeystroke(alternateKeyStroke);
      if (prevAssignedActionId != null && !prevAssignedActionId.equals(actionId))       AppLogger.fine("String_Node_Str" + keyStrokeString + "String_Node_Str"+ actionId);
    }
  }
  if (primaryKeyStroke != null || alternateKeyStroke != null) {
    if (primaryKeyStroke == null) {
      AppLogger.fine("String_Node_Str" + actionId + "String_Node_Str");
      primaryActionsReadKeymap.put(actionId,alternateKeyStroke);
      alternateActionsReadKeymap.put(actionId,null);
      setModified();
    }
 else {
      primaryActionsReadKeymap.put(actionId,primaryKeyStroke);
      alternateActionsReadKeymap.put(actionId,alternateKeyStroke);
    }
  }
}

Fixed version (ground truth):
/** 
 * Parses the keystrokes defined in the given attribute map (if any) and associates them with the given action id. The keystroke will not be associated in any of the following cases: <ul> <li>the keystrokes attributes do not contain any value.</li> <li>the keystrokes attributes have values that do not represent a valid KeyStroke (syntax error).</li> </ul> If a given keystroke is already associated to an action, the existing association is replaced.  If there is a valid alternative keystroke defined but there is no valid primary keystroke defined, the primary keystroke  is replaced by the alternative keystroke.
 * @param actionId the action id to associate the keystroke with
 * @param attributes the attributes map that holds the value
 */
private void processKeystrokeAttribute(String actionId,Attributes attributes){
  String keyStrokeString;
  KeyStroke alternateKeyStroke=null;
  KeyStroke primaryKeyStroke=null;
  keyStrokeString=attributes.getValue(PRIMARY_KEYSTROKE_ATTRIBUTE);
  if (keyStrokeString != null) {
    primaryKeyStroke=KeyStroke.getKeyStroke(keyStrokeString);
    if (primaryKeyStroke == null)     AppLogger.info("String_Node_Str" + keyStrokeString);
 else {
      String prevAssignedActionId=ActionKeymap.getRegisteredActionIdForKeystroke(primaryKeyStroke);
      if (prevAssignedActionId != null && !prevAssignedActionId.equals(actionId))       AppLogger.fine("String_Node_Str" + keyStrokeString + "String_Node_Str"+ actionId);
    }
  }
  keyStrokeString=attributes.getValue(ALTERNATE_KEYSTROKE_ATTRIBUTE);
  if (keyStrokeString != null) {
    alternateKeyStroke=KeyStroke.getKeyStroke(keyStrokeString);
    if (alternateKeyStroke == null)     AppLogger.info("String_Node_Str" + keyStrokeString);
 else {
      String prevAssignedActionId=ActionKeymap.getRegisteredActionIdForKeystroke(alternateKeyStroke);
      if (prevAssignedActionId != null && !prevAssignedActionId.equals(actionId))       AppLogger.fine("String_Node_Str" + keyStrokeString + "String_Node_Str"+ actionId);
    }
  }
  if (primaryKeyStroke == null) {
    AppLogger.fine("String_Node_Str" + actionId + "String_Node_Str");
    primaryActionsReadKeymap.put(actionId,alternateKeyStroke);
    alternateActionsReadKeymap.put(actionId,null);
    setModified();
  }
 else {
    primaryActionsReadKeymap.put(actionId,primaryKeyStroke);
    alternateActionsReadKeymap.put(actionId,alternateKeyStroke);
  }
}