Program: 115215
Project: 115215
Buggy source:
protected void setOCFormDataAuditLogs(StudyBean study,OdmClinicalDataBean data,String studySubjectOids,String ecIds,HashMap<Integer,String> formOidPoses){
  this.setOCFormDataAuditsTypesExpected();
  logger.debug("String_Node_Str");
  logger.error("String_Node_Str" + this.getOCFormDataAuditsSql(studySubjectOids,ecIds));
  ArrayList rows=select(this.getOCFormDataAuditsSql(studySubjectOids,ecIds));
  Iterator iter=rows.iterator();
  while (iter.hasNext()) {
    HashMap row=(HashMap)iter.next();
    Integer ecId=(Integer)row.get("String_Node_Str");
    Integer auditId=(Integer)row.get("String_Node_Str");
    String type=(String)row.get("String_Node_Str");
    Integer userId=(Integer)row.get("String_Node_Str");
    Date auditDate=(Date)row.get("String_Node_Str");
    String auditReason=(String)row.get("String_Node_Str");
    String oldValue=(String)row.get("String_Node_Str");
    String newValue=(String)row.get("String_Node_Str");
    Integer typeId=(Integer)row.get("String_Node_Str");
    if (formOidPoses.containsKey(ecId)) {
      String[] poses=formOidPoses.get(ecId).split("String_Node_Str");
      ExportFormDataBean form=data.getExportSubjectData().get(Integer.parseInt(poses[0])).getExportStudyEventData().get(Integer.parseInt(poses[1])).getExportFormData().get(Integer.parseInt(poses[2]));
      AuditLogBean auditLog=new AuditLogBean();
      auditLog.setOid("String_Node_Str" + auditId);
      auditLog.setUserId("String_Node_Str" + userId);
      auditLog.setDatetimeStamp(auditDate);
      auditLog.setType(type);
      auditLog.setReasonForChange(auditReason);
      if (typeId == 8 || typeId == 10 || typeId == 11 || typeId == 14 || typeId == 15 || typeId == 16) {
        if ("String_Node_Str".equals(newValue)) {
          auditLog.setNewValue(Status.INVALID.getName());
        }
 else {
          auditLog.setNewValue(Status.getFromMap(Integer.parseInt(newValue)).getName());
        }
        if ("String_Node_Str".equals(oldValue)) {
          auditLog.setOldValue(Status.INVALID.getName());
        }
 else {
          auditLog.setOldValue(Status.getFromMap(Integer.parseInt(oldValue)).getName());
        }
      }
 else       if (typeId == 32) {
        if ("String_Node_Str".equals(newValue)) {
          auditLog.setNewValue("String_Node_Str");
        }
 else {
          auditLog.setNewValue("String_Node_Str");
        }
        if ("String_Node_Str".equals(oldValue)) {
          auditLog.setOldValue("String_Node_Str");
        }
 else {
          auditLog.setOldValue("String_Node_Str");
        }
      }
 else {
        auditLog.setNewValue(newValue);
        auditLog.setOldValue(oldValue);
      }
      AuditLogsBean logs=form.getAuditLogs();
      if (logs.getEntityID() == null || logs.getEntityID().length() <= 0) {
        logs.setEntityID(form.getFormOID());
      }
      logs.getAuditLogs().add(auditLog);
      form.setAuditLogs(logs);
    }
  }
}

Fixed version (ground truth):
protected void setOCFormDataAuditLogs(StudyBean study,OdmClinicalDataBean data,String studySubjectOids,String ecIds,HashMap<Integer,String> formOidPoses){
  this.setOCFormDataAuditsTypesExpected();
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + this.getOCFormDataAuditsSql(studySubjectOids,ecIds));
  ArrayList rows=select(this.getOCFormDataAuditsSql(studySubjectOids,ecIds));
  Iterator iter=rows.iterator();
  while (iter.hasNext()) {
    HashMap row=(HashMap)iter.next();
    Integer ecId=(Integer)row.get("String_Node_Str");
    Integer auditId=(Integer)row.get("String_Node_Str");
    String type=(String)row.get("String_Node_Str");
    Integer userId=(Integer)row.get("String_Node_Str");
    Date auditDate=(Date)row.get("String_Node_Str");
    String auditReason=(String)row.get("String_Node_Str");
    String oldValue=(String)row.get("String_Node_Str");
    String newValue=(String)row.get("String_Node_Str");
    Integer typeId=(Integer)row.get("String_Node_Str");
    if (formOidPoses.containsKey(ecId)) {
      String[] poses=formOidPoses.get(ecId).split("String_Node_Str");
      ExportFormDataBean form=data.getExportSubjectData().get(Integer.parseInt(poses[0])).getExportStudyEventData().get(Integer.parseInt(poses[1])).getExportFormData().get(Integer.parseInt(poses[2]));
      AuditLogBean auditLog=new AuditLogBean();
      auditLog.setOid("String_Node_Str" + auditId);
      auditLog.setUserId("String_Node_Str" + userId);
      auditLog.setDatetimeStamp(auditDate);
      auditLog.setType(type);
      auditLog.setReasonForChange(auditReason);
      if (typeId == 8 || typeId == 10 || typeId == 11 || typeId == 14 || typeId == 15 || typeId == 16) {
        if ("String_Node_Str".equals(newValue)) {
          auditLog.setNewValue(Status.INVALID.getName());
        }
 else {
          auditLog.setNewValue(Status.getFromMap(Integer.parseInt(newValue)).getName());
        }
        if ("String_Node_Str".equals(oldValue)) {
          auditLog.setOldValue(Status.INVALID.getName());
        }
 else {
          auditLog.setOldValue(Status.getFromMap(Integer.parseInt(oldValue)).getName());
        }
      }
 else       if (typeId == 32) {
        if ("String_Node_Str".equals(newValue)) {
          auditLog.setNewValue("String_Node_Str");
        }
 else {
          auditLog.setNewValue("String_Node_Str");
        }
        if ("String_Node_Str".equals(oldValue)) {
          auditLog.setOldValue("String_Node_Str");
        }
 else {
          auditLog.setOldValue("String_Node_Str");
        }
      }
 else {
        auditLog.setNewValue(newValue);
        auditLog.setOldValue(oldValue);
      }
      AuditLogsBean logs=form.getAuditLogs();
      if (logs.getEntityID() == null || logs.getEntityID().length() <= 0) {
        logs.setEntityID(form.getFormOID());
      }
      logs.getAuditLogs().add(auditLog);
      form.setAuditLogs(logs);
    }
  }
}