Program: 189327
Project: 189327
Buggy source:
/** 
 * Verify this step has successfully been completed. This may be called from two places, here on the PersonalInfo form and from the confirmation step to ensure that everything has been completed.
 * @return true if there were no errors, otherwise false.
 */
public static boolean verify(Submission sub){
  int numberOfErrorsBefore=validation.errors().size();
  if (isFieldRequired(STUDENT_FIRST_NAME) && isFieldRequired(STUDENT_LAST_NAME)) {
    if (isEmpty(sub.getStudentFirstName()) && isEmpty(sub.getStudentLastName())) {
      validation.addError("String_Node_Str","String_Node_Str");
      validation.addError("String_Node_Str","String_Node_Str");
    }
  }
 else   if (isFieldRequired(STUDENT_FIRST_NAME) && isEmpty(sub.getStudentFirstName())) {
    validation.addError("String_Node_Str","String_Node_Str");
  }
 else   if (isFieldRequired(STUDENT_LAST_NAME) && isEmpty(sub.getStudentFirstName())) {
    validation.addError("String_Node_Str","String_Node_Str");
  }
  if (isFieldRequired(STUDENT_MIDDLE_NAME) && isEmpty(sub.getStudentMiddleName()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(STUDENT_ORCID) && isEmpty(sub.getOrcid()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getStudentBirthYear() != null && sub.getStudentBirthYear() < 1900)   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(STUDENT_BIRTH_YEAR) && sub.getStudentBirthYear() == null)   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getProgram() != null && !isValidProgram(sub.getProgram()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PROGRAM) && isEmpty(sub.getProgram()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getCollege() != null && !isValidCollege(sub.getCollege()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(COLLEGE) && isEmpty(sub.getCollege()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getDepartment() != null && !isValidDepartment(sub.getDepartment()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DEPARTMENT) && isEmpty(sub.getDepartment()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getDegree() != null && !isValidDegree(sub.getDegree()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DEGREE) && isEmpty(sub.getDegree()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getMajor() != null && !isValidMajor(sub.getMajor()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(MAJOR) && isEmpty(sub.getMajor()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PERMANENT_PHONE_NUMBER) && isEmpty(sub.getSubmitter().getPermanentPhoneNumber()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PERMANENT_POSTAL_ADDRESS) && isEmpty(sub.getSubmitter().getPermanentPostalAddress()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PERMANENT_EMAIL_ADDRESS) && isEmpty(sub.getSubmitter().getPermanentEmailAddress()))   validation.addError("String_Node_Str","String_Node_Str");
 else   if (isFieldEnabled(PERMANENT_EMAIL_ADDRESS) && sub.getSubmitter().getPermanentEmailAddress() != null) {
    try {
      new InternetAddress(sub.getSubmitter().getPermanentEmailAddress()).validate();
    }
 catch (    AddressException e) {
      validation.addError("String_Node_Str","String_Node_Str" + sub.getSubmitter().getPermanentEmailAddress() + "String_Node_Str");
    }
  }
  if (isFieldRequired(CURRENT_PHONE_NUMBER) && isEmpty(sub.getSubmitter().getCurrentPhoneNumber()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(CURRENT_POSTAL_ADDRESS) && isEmpty(sub.getSubmitter().getCurrentPostalAddress()))   validation.addError("String_Node_Str","String_Node_Str");
  if (numberOfErrorsBefore == validation.errors().size())   return true;
 else   return false;
}

Fixed version (ground truth):
/** 
 * Verify this step has successfully been completed. This may be called from two places, here on the PersonalInfo form and from the confirmation step to ensure that everything has been completed.
 * @return true if there were no errors, otherwise false.
 */
public static boolean verify(Submission sub){
  int numberOfErrorsBefore=validation.errors().size();
  if (isFieldRequired(STUDENT_FIRST_NAME) && isFieldRequired(STUDENT_LAST_NAME)) {
    if (isEmpty(sub.getStudentFirstName()) && isEmpty(sub.getStudentLastName())) {
      validation.addError("String_Node_Str","String_Node_Str");
      validation.addError("String_Node_Str","String_Node_Str");
    }
  }
 else   if (isFieldRequired(STUDENT_FIRST_NAME) && isEmpty(sub.getStudentFirstName())) {
    validation.addError("String_Node_Str","String_Node_Str");
  }
 else   if (isFieldRequired(STUDENT_LAST_NAME) && isEmpty(sub.getStudentFirstName())) {
    validation.addError("String_Node_Str","String_Node_Str");
  }
  if (isFieldRequired(STUDENT_MIDDLE_NAME) && isEmpty(sub.getStudentMiddleName()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(STUDENT_ORCID) && isEmpty(sub.getSubmitter().getOrcid()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getStudentBirthYear() != null && sub.getStudentBirthYear() < 1900)   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(STUDENT_BIRTH_YEAR) && sub.getStudentBirthYear() == null)   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getProgram() != null && !isValidProgram(sub.getProgram()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PROGRAM) && isEmpty(sub.getProgram()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getCollege() != null && !isValidCollege(sub.getCollege()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(COLLEGE) && isEmpty(sub.getCollege()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getDepartment() != null && !isValidDepartment(sub.getDepartment()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DEPARTMENT) && isEmpty(sub.getDepartment()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getDegree() != null && !isValidDegree(sub.getDegree()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(DEGREE) && isEmpty(sub.getDegree()))   validation.addError("String_Node_Str","String_Node_Str");
  if (sub.getMajor() != null && !isValidMajor(sub.getMajor()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(MAJOR) && isEmpty(sub.getMajor()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PERMANENT_PHONE_NUMBER) && isEmpty(sub.getSubmitter().getPermanentPhoneNumber()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PERMANENT_POSTAL_ADDRESS) && isEmpty(sub.getSubmitter().getPermanentPostalAddress()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(PERMANENT_EMAIL_ADDRESS) && isEmpty(sub.getSubmitter().getPermanentEmailAddress()))   validation.addError("String_Node_Str","String_Node_Str");
 else   if (isFieldEnabled(PERMANENT_EMAIL_ADDRESS) && sub.getSubmitter().getPermanentEmailAddress() != null) {
    try {
      new InternetAddress(sub.getSubmitter().getPermanentEmailAddress()).validate();
    }
 catch (    AddressException e) {
      validation.addError("String_Node_Str","String_Node_Str" + sub.getSubmitter().getPermanentEmailAddress() + "String_Node_Str");
    }
  }
  if (isFieldRequired(CURRENT_PHONE_NUMBER) && isEmpty(sub.getSubmitter().getCurrentPhoneNumber()))   validation.addError("String_Node_Str","String_Node_Str");
  if (isFieldRequired(CURRENT_POSTAL_ADDRESS) && isEmpty(sub.getSubmitter().getCurrentPostalAddress()))   validation.addError("String_Node_Str","String_Node_Str");
  if (numberOfErrorsBefore == validation.errors().size())   return true;
 else   return false;
}