Program: 189393
Project: 189393
Buggy source:
/** 
 * The method to add a file to the submission being viewed. This checks the type of file being uploaded (note, primary, supplement) and calls the appropriate private method.
 * @param subId (The submission id)
 */
@Security(RoleType.REVIEWER) private static void addFile(Submission sub){
  String uploadType=params.get("String_Node_Str");
  if ("String_Node_Str".equals(uploadType)) {
    uploadPrimary(sub);
  }
 else   if ("String_Node_Str".equals(uploadType)) {
    uploadAdditional(sub);
  }
  if (params.get("String_Node_Str") != null) {
    String subject=params.get("String_Node_Str");
    String comment=params.get("String_Node_Str");
    if (subject == null || subject.isEmpty())     validation.addError("String_Node_Str","String_Node_Str");
    if (comment == null || comment.isEmpty())     validation.addError("String_Node_Str","String_Node_Str");
    if (!validation.hasErrors()) {
      VireoEmail email=emailService.createEmail();
      email.addParameters(sub);
      email.addTo(sub.getSubmitter());
      email.setReplyTo(context.getPerson());
      if (params.get("String_Node_Str") != null && sub.getCommitteeContactEmail() != null) {
        email.addCc(sub.getCommitteeContactEmail());
      }
      email.setSubject(subject);
      email.setMessage(comment);
      email.setLogOnCompletion(context.getPerson(),sub);
      emailService.sendEmail(email,false);
    }
  }
  if (!validation.hasErrors()) {
    if (params.get("String_Node_Str") != null)     sub.setState(stateManager.getState("String_Node_Str"));
    sub.save();
  }
}

Fixed version (ground truth):
/** 
 * The method to add a file to the submission being viewed. This checks the type of file being uploaded (note, primary, supplement) and calls the appropriate private method.
 * @param subId (The submission id)
 */
@Security(RoleType.REVIEWER) private static void addFile(Submission sub){
  String uploadType=params.get("String_Node_Str");
  if ("String_Node_Str".equals(uploadType)) {
    uploadPrimary(sub);
  }
 else   if ("String_Node_Str".equals(uploadType)) {
    uploadAdditional(sub);
  }
  VireoEmail email=null;
  if (params.get("String_Node_Str") != null) {
    String subject=params.get("String_Node_Str");
    String comment=params.get("String_Node_Str");
    if (subject == null || subject.isEmpty())     validation.addError("String_Node_Str","String_Node_Str");
    if (comment == null || comment.isEmpty())     validation.addError("String_Node_Str","String_Node_Str");
    if (!validation.hasErrors()) {
      email=emailService.createEmail();
      email.addParameters(sub);
      email.addTo(sub.getSubmitter());
      email.setFrom(context.getPerson());
      email.setReplyTo(context.getPerson());
      if (params.get("String_Node_Str") != null && sub.getCommitteeContactEmail() != null) {
        email.addCc(sub.getCommitteeContactEmail());
      }
      email.setSubject(subject);
      email.setMessage(comment);
      email.setLogOnCompletion(context.getPerson(),sub);
    }
  }
  if (!validation.hasErrors()) {
    if (params.get("String_Node_Str") != null)     sub.setState(stateManager.getState("String_Node_Str"));
    sub.save();
  }
  if (email != null)   emailService.sendEmail(email,false);
}