Program: 189349
Project: 189349
Buggy source:
/** 
 * Helper function to take an array of strings as (supplied from parameters in a form request with an autocomplete email field)  These strings may be email addresses, RecipientType enum names, or AdminGroup names. Process it into an actual list of strings  that are proper email addresses.
 * @param designee_string_array - the heterogeneous string array of email addresses, RecipientTypes, and AdminGroups
 * @return - a list of strings that are proper email addresses
 */
public static List<String> processEmailDesigneeArray(String[] designees,Submission sub){
  List<String> addresses=new ArrayList<String>();
  for (  String designee : designees) {
    if (designee.trim().length() != 0) {
      RecipientType recipientType=null;
      for (      RecipientType oneRecipientType : RecipientType.values()) {
        if (oneRecipientType.name().equals(designee.trim())) {
          recipientType=RecipientType.valueOf(designee.trim());
          break;
        }
      }
      if (recipientType != null) {
        List<String> recipientEmailAddresses=EmailByRecipientType.getRecipients(sub,recipientType);
        for (        String recipientEmailAddress : recipientEmailAddresses)         addresses.add(recipientEmailAddress);
      }
 else {
        AdministrativeGroup admingroup=null;
        for (        AdministrativeGroup oneAdmingroup : settingRepo.findAllAdministrativeGroups()) {
          if (oneAdmingroup.getName().equals(designee.trim())) {
            admingroup=oneAdmingroup;
            break;
          }
        }
        if (admingroup == null) {
          addresses.add(designee.trim());
        }
 else {
          for (          String emailAddr : admingroup.getEmails().values()) {
            addresses.add(emailAddr);
          }
        }
      }
    }
  }
  return addresses;
}

Fixed version (ground truth):
/** 
 * Helper function to take an array of strings as (supplied from parameters in a form request with an autocomplete email field)  These strings may be email addresses, RecipientType enum names, or AdminGroup names. Process it into an actual list of strings  that are proper email addresses.
 * @param designee_string_array - the heterogeneous string array of email addresses, RecipientTypes, and AdminGroups
 * @return - a list of strings that are proper email addresses
 */
public static List<String> processEmailDesigneeArray(String[] designees,Submission sub){
  List<String> addresses=new ArrayList<String>();
  for (  String designee : designees) {
    if (designee.trim().length() != 0) {
      RecipientType recipientType=null;
      for (      RecipientType oneRecipientType : RecipientType.values()) {
        if (oneRecipientType.name().equals(designee.trim())) {
          recipientType=RecipientType.valueOf(designee.trim());
          break;
        }
      }
      if (recipientType != null) {
        List<String> recipientEmailAddresses=EmailByRecipientType.getRecipients(sub,recipientType,null);
        for (        String recipientEmailAddress : recipientEmailAddresses)         addresses.add(recipientEmailAddress);
      }
 else {
        AdministrativeGroup admingroup=null;
        for (        AdministrativeGroup oneAdmingroup : settingRepo.findAllAdministrativeGroups()) {
          if (oneAdmingroup.getName().equals(designee.trim())) {
            admingroup=oneAdmingroup;
            break;
          }
        }
        if (admingroup == null) {
          addresses.add(designee.trim());
        }
 else {
          for (          String emailAddr : admingroup.getEmails().values()) {
            addresses.add(emailAddr);
          }
        }
      }
    }
  }
  return addresses;
}