Program: 88611
Project: 88611
Buggy source:
/** 
 * Accepts the MMS version into MD for the specified violation type
 * @param violationType the type of violation to be accepted
 * @param commit will commit to MMS if true, will accept from MMS is false
 * @param targets limits processing of violations to only those elements that are contained in the collection. if null, does not limit processing. ** COLLECTION IS MODIFIED DURING FUNCTION EXECUTION  exception will be thrown if specified with targetIDs.
 * @param targetIDs limits processing of violations to only those elements whose IDs are contained in the collection. if null, does not limit processing. ** COLLECTION IS MODIFIED DURING FUNCTION EXECUTION  exception will be thrown if specified with targets.
 * @throws ClassNotFoundException , NoSuchMethodException, InvocationTargetException, IllegalAccessException
 */
private void processValidationResults(String violationType,Collection<Element> targets,Collection<String> targetIDs,boolean commit) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  if (targets != null && targetIDs != null) {
    throw new IllegalAccessException("String_Node_Str");
  }
  violationType=standardize(violationType);
  MagicDrawHelper.generalMessage((commit ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (targets != null ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ violationType+ "String_Node_Str");
  int ruleIndex=lookupListIndex(violationType);
  String className=VALIDATION_OPTIONS[ruleIndex][(commit ? COMMIT_ACTION : ACCEPT_ACTION)];
  if (pooledViolations.get(ruleIndex).isEmpty()) {
    MagicDrawHelper.generalMessage("String_Node_Str" + violationType + "String_Node_Str"+ (commit ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    return;
  }
 else   if (className.equals("String_Node_Str")) {
    MagicDrawHelper.generalMessage("String_Node_Str" + (commit ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ violationType+ "String_Node_Str");
    return;
  }
  List<ValidationRuleViolation> violationList=pooledViolations.get(ruleIndex);
  if (violationType.equals("String_Node_Str")) {
    if (!commit || !violationList.get(0).getComment().equals("String_Node_Str")) {
      return;
    }
  }
  int actionIndex=0;
  while (actionIndex < violationList.get(0).getActions().size() && !(violationList.get(0).getActions().get(actionIndex).getClass().getSimpleName().equals(className)))   actionIndex++;
  if (actionIndex >= violationList.get(0).getActions().size() || !(violationList.get(0).getActions().get(actionIndex).getClass().getSimpleName().equals(className)))   throw new ClassNotFoundException("String_Node_Str" + className + "String_Node_Str"+ violationType);
  if (violationType.equals("String_Node_Str")) {
    for (    ValidationRuleViolation vrv : violationList) {
      Utils.forceDialogReturnFalse();
      ((InitializeProjectModel)vrv.getActions().get(actionIndex)).actionPerformed(new ActionEvent(new JButton(),5,"String_Node_Str"));
    }
  }
 else   if (violationType.equals("String_Node_Str")) {
    for (    ValidationRuleViolation vrv : violationList) {
      if ((targets == null || targets.remove(vrv.getElement())) && (targetIDs == null) || targetIDs.remove(getIdFromVRVComment(vrv))) {
        if (commit) {
          vrv.getActions().get(actionIndex).actionPerformed(new ActionEvent(new JButton(),5,"String_Node_Str"));
        }
 else {
          vrv.getActions().get(actionIndex).actionPerformed(new ActionEvent(new JButton(),5,"String_Node_Str"));
        }
      }
    }
  }
 else {
    java.lang.reflect.Method getAnnotation=violationList.get(0).getActions().get(actionIndex).getClass().getMethod("String_Node_Str");
    java.lang.reflect.Method execute=violationList.get(0).getActions().get(actionIndex).getClass().getMethod("String_Node_Str",new java.lang.Class[]{Collection.class});
    Collection<Annotation> annos=new LinkedList<Annotation>();
    for (    ValidationRuleViolation vrv : violationList) {
      if ((targets == null || targets.remove(vrv.getElement())) && (targetIDs == null) || targetIDs.remove(getIdFromVRVComment(vrv))) {
        Annotation anno=(Annotation)getAnnotation.invoke(vrv.getActions().get(actionIndex));
        annos.add(anno);
        System.out.println("String_Node_Str" + (commit ? "String_Node_Str" : "String_Node_Str") + (vrv.getElement() != null ? vrv.getElement().getHumanName() : "String_Node_Str")+ "String_Node_Str"+ vrv.getComment());
      }
    }
    Utils.forceDialogReturnFalse();
    execute.invoke(violationList.get(0).getActions().get(actionIndex),annos);
  }
}

Fixed version (ground truth):
/** 
 * Accepts the MMS version into MD for the specified violation type
 * @param violationType the type of violation to be accepted
 * @param commit will commit to MMS if true, will accept from MMS is false
 * @param targets limits processing of violations to only those elements that are contained in the collection. if null, does not limit processing. ** COLLECTION IS MODIFIED DURING FUNCTION EXECUTION  exception will be thrown if specified with targetIDs.
 * @param targetIDs limits processing of violations to only those elements whose IDs are contained in the collection. if null, does not limit processing. ** COLLECTION IS MODIFIED DURING FUNCTION EXECUTION  exception will be thrown if specified with targets.
 * @throws ClassNotFoundException , NoSuchMethodException, InvocationTargetException, IllegalAccessException
 */
private void processValidationResults(String violationType,Collection<Element> targets,Collection<String> targetIDs,boolean commit) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  if (targets != null && targetIDs != null) {
    throw new IllegalAccessException("String_Node_Str");
  }
  violationType=standardize(violationType);
  MagicDrawHelper.generalMessage((commit ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + (targets != null ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ violationType+ "String_Node_Str");
  int ruleIndex=lookupListIndex(violationType);
  String className=VALIDATION_OPTIONS[ruleIndex][(commit ? COMMIT_ACTION : ACCEPT_ACTION)];
  if (pooledViolations.get(ruleIndex).isEmpty()) {
    MagicDrawHelper.generalMessage("String_Node_Str" + violationType + "String_Node_Str"+ (commit ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    return;
  }
 else   if (className.equals("String_Node_Str")) {
    MagicDrawHelper.generalMessage("String_Node_Str" + (commit ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ violationType+ "String_Node_Str");
    return;
  }
  List<ValidationRuleViolation> violationList=pooledViolations.get(ruleIndex);
  if (violationType.equals("String_Node_Str")) {
    if (!commit || !violationList.get(0).getComment().equals("String_Node_Str")) {
      return;
    }
  }
  int actionIndex=0;
  while (actionIndex < violationList.get(0).getActions().size() && !(violationList.get(0).getActions().get(actionIndex).getClass().getSimpleName().equals(className)))   actionIndex++;
  if (actionIndex >= violationList.get(0).getActions().size() || !(violationList.get(0).getActions().get(actionIndex).getClass().getSimpleName().equals(className)))   throw new ClassNotFoundException("String_Node_Str" + className + "String_Node_Str"+ violationType);
  if (violationType.equals("String_Node_Str")) {
    for (    ValidationRuleViolation vrv : violationList) {
      Utils.forceDialogReturnFalse();
      ((InitializeProjectModel)vrv.getActions().get(actionIndex)).actionPerformed(new ActionEvent(new JButton(),5,"String_Node_Str"));
    }
  }
 else   if (violationType.equals("String_Node_Str")) {
    for (    ValidationRuleViolation vrv : violationList) {
      if ((targets == null || targets.remove(vrv.getElement())) && (targetIDs == null || targetIDs.remove(getIdFromVRVComment(vrv)))) {
        if (commit) {
          vrv.getActions().get(actionIndex).actionPerformed(new ActionEvent(new JButton(),5,"String_Node_Str"));
        }
 else {
          vrv.getActions().get(actionIndex).actionPerformed(new ActionEvent(new JButton(),5,"String_Node_Str"));
        }
      }
    }
  }
 else {
    java.lang.reflect.Method getAnnotation=violationList.get(0).getActions().get(actionIndex).getClass().getMethod("String_Node_Str");
    java.lang.reflect.Method execute=violationList.get(0).getActions().get(actionIndex).getClass().getMethod("String_Node_Str",new java.lang.Class[]{Collection.class});
    Collection<Annotation> annos=new LinkedList<Annotation>();
    for (    ValidationRuleViolation vrv : violationList) {
      if ((targets == null || targets.remove(vrv.getElement())) && (targetIDs == null || targetIDs.remove(getIdFromVRVComment(vrv)))) {
        Annotation anno=(Annotation)getAnnotation.invoke(vrv.getActions().get(actionIndex));
        annos.add(anno);
        System.out.println("String_Node_Str" + (commit ? "String_Node_Str" : "String_Node_Str") + (vrv.getElement() != null ? vrv.getElement().getHumanName() : "String_Node_Str")+ "String_Node_Str"+ vrv.getComment());
      }
    }
    Utils.forceDialogReturnFalse();
    execute.invoke(violationList.get(0).getActions().get(actionIndex),annos);
  }
}