Program: 189320
Project: 189320
Buggy source:
/** 
 * Verify that all the document information is correct. This will be accessed from two places, the document info page as well as the confirmation page.
 * @return True if there are no errors found, otherwise false.
 */
public static boolean verify(Submission sub){
  int numberOfErrorsBefore=validation.errors().size();
  if (isFieldRequired(DOCUMENT_TITLE) && isEmpty(sub.getDocumentTitle()))   validation.addError("String_Node_Str","String_Node_Str");
  if (!isValidDegreeMonth(sub.getGraduationMonth()))   validation.addError("String_Node_Str","String_Node_Str");
  if (!isValidDegreeYear(sub.getGraduationYear()))   validation.addError("String_Node_Str","String_Node_Str");
  Date now=new Date();
  Date min=new Date(-2208967200000L);
  Date max=new Date(now.getTime() + (365 * 24 * 60* 60* 1000L));
  DateFormat formatter=new SimpleDateFormat("String_Node_Str");
  if (isFieldRequired(DEFENSE_DATE) && (sub.getDefenseDate() == null))   validation.addError("String_Node_Str","String_Node_Str");
 else   if (sub.getDefenseDate() != null && (!sub.getDefenseDate().after(min) || !sub.getDefenseDate().before(max)))   validation.addError("String_Node_Str","String_Node_Str" + formatter.format(min) + "String_Node_Str"+ formatter.format(max));
  if (!isValidDocType(sub.getDocumentType()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DOCUMENT_ABSTRACT) && isEmpty(sub.getDocumentAbstract()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DOCUMENT_KEYWORDS) && isEmpty(sub.getDocumentKeywords()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldEnabled(DOCUMENT_SUBJECTS)) {
    for (    String subject : sub.getDocumentSubjects()) {
      if (proquestRepo.findSubjectByDescription(subject) == null) {
        validation.addError("String_Node_Str","String_Node_Str");
      }
    }
    if (isFieldRequired(DOCUMENT_SUBJECTS) && sub.getDocumentSubjects().size() == 0) {
      validation.addError("String_Node_Str","String_Node_Str");
    }
  }
  if (isFieldRequired(DOCUMENT_LANGUAGE) && isEmpty(sub.getDocumentLanguage()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(COMMITTEE) && !validation.hasError("String_Node_Str")) {
    List<TransientMember> committee=loadCommitteeMembers(sub);
    validateCommitteeMembers(sub,committee);
  }
  if (isFieldRequired(COMMITTEE_CONTACT_EMAIL) && isEmpty(sub.getCommitteeContactEmail())) {
    validation.addError("String_Node_Str","String_Node_Str");
  }
 else   if (isFieldEnabled(COMMITTEE_CONTACT_EMAIL) && !isEmpty(sub.getCommitteeContactEmail())) {
    try {
      new InternetAddress(sub.getCommitteeContactEmail()).validate();
    }
 catch (    AddressException e) {
      validation.addError("String_Node_Str","String_Node_Str" + sub.getCommitteeContactEmail() + "String_Node_Str");
    }
  }
  if (isFieldEnabled(PUBLISHED_MATERIAL)) {
    if (sub.getPublishedMaterial() != null && sub.getPublishedMaterial().trim().length() == 0) {
      validation.addError("String_Node_Str","String_Node_Str");
    }
  }
  for (  EmbargoGuarantor eg : EmbargoGuarantor.values()) {
    String fieldName=eg.name().equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str" + eg.name();
    FieldConfig field=FieldConfig.valueOf(fieldName);
    if (isFieldRequired(field) && sub.getEmbargoTypeByGuarantor(eg) == null)     validation.addError("String_Node_Str" + eg.name(),"String_Node_Str" + eg.name().toLowerCase() + "String_Node_Str");
  }
  if (numberOfErrorsBefore == validation.errors().size())   return true;
 else   return false;
}

Fixed version (ground truth):
/** 
 * Verify that all the document information is correct. This will be accessed from two places, the document info page as well as the confirmation page.
 * @return True if there are no errors found, otherwise false.
 */
public static boolean verify(Submission sub){
  int numberOfErrorsBefore=validation.errors().size();
  if (isFieldRequired(DOCUMENT_TITLE) && isEmpty(sub.getDocumentTitle()))   validation.addError("String_Node_Str","String_Node_Str");
  if (!isValidDegreeMonth(sub.getGraduationMonth()))   validation.addError("String_Node_Str","String_Node_Str");
  if (!isValidDegreeYear(sub.getGraduationYear()))   validation.addError("String_Node_Str","String_Node_Str");
  Date now=new Date();
  Date min=new Date(-2208967200000L);
  Date max=new Date(now.getTime() + (365 * 24 * 60* 60* 1000L));
  DateFormat formatter=new SimpleDateFormat("String_Node_Str");
  if (isFieldRequired(DEFENSE_DATE) && (sub.getDefenseDate() == null))   validation.addError("String_Node_Str","String_Node_Str");
 else   if (sub.getDefenseDate() != null && (!sub.getDefenseDate().after(min) || !sub.getDefenseDate().before(max)))   validation.addError("String_Node_Str","String_Node_Str" + formatter.format(min) + "String_Node_Str"+ formatter.format(max));
  if (!isValidDocType(sub.getDocumentType()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DOCUMENT_ABSTRACT) && isEmpty(sub.getDocumentAbstract()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DOCUMENT_KEYWORDS) && isEmpty(sub.getDocumentKeywords()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldEnabled(DOCUMENT_SUBJECTS)) {
    for (    String subject : sub.getDocumentSubjects()) {
      if (proquestRepo.findSubjectByDescription(subject) == null) {
        validation.addError("String_Node_Str","String_Node_Str");
      }
    }
    if (isFieldRequired(DOCUMENT_SUBJECTS) && sub.getDocumentSubjects().size() == 0) {
      validation.addError("String_Node_Str","String_Node_Str");
    }
  }
  if (isFieldRequired(DOCUMENT_LANGUAGE) && isEmpty(sub.getDocumentLanguage()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(COMMITTEE) && !validation.hasError("String_Node_Str")) {
    List<TransientMember> committee=loadCommitteeMembers(sub);
    validateCommitteeMembers(sub,committee);
  }
  if (isFieldRequired(COMMITTEE_CONTACT_EMAIL) && isEmpty(sub.getCommitteeContactEmail())) {
    validation.addError("String_Node_Str","String_Node_Str");
  }
 else   if (isFieldEnabled(COMMITTEE_CONTACT_EMAIL) && !isEmpty(sub.getCommitteeContactEmail())) {
    try {
      new InternetAddress(sub.getCommitteeContactEmail()).validate();
    }
 catch (    AddressException e) {
      validation.addError("String_Node_Str","String_Node_Str" + sub.getCommitteeContactEmail() + "String_Node_Str");
    }
  }
  if (isFieldEnabled(PUBLISHED_MATERIAL)) {
    if (sub.getPublishedMaterial() != null && sub.getPublishedMaterial().trim().length() == 0) {
      validation.addError("String_Node_Str","String_Node_Str");
    }
  }
  for (  EmbargoGuarantor eg : EmbargoGuarantor.values()) {
    String fieldName=eg.name().equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str" + eg.name();
    FieldConfig field=FieldConfig.valueOf(fieldName);
    if (isFieldRequired(field) && sub.getEmbargoTypeByGuarantor(eg) == null) {
      if (eg != EmbargoGuarantor.PROQUEST || sub.getUMIRelease())       validation.addError("String_Node_Str" + eg.name(),"String_Node_Str" + eg.name().toLowerCase() + "String_Node_Str");
    }
  }
  if (numberOfErrorsBefore == validation.errors().size())   return true;
 else   return false;
}