Program: 115205
Project: 115205
Buggy source:
protected void setOCEventDataAuditLogs(StudyBean study,OdmClinicalDataBean data,String studySubjectOids,HashMap<String,String> evnOidPoses){
  this.setOCEventDataAuditsTypesExpected();
  logger.debug("String_Node_Str");
  logger.error("String_Node_Str" + this.getOCEventDataAuditsSql(studySubjectOids));
  ArrayList rows=select(this.getOCEventDataAuditsSql(studySubjectOids));
  Iterator iter=rows.iterator();
  while (iter.hasNext()) {
    HashMap row=(HashMap)iter.next();
    String studySubjectLabel=(String)row.get("String_Node_Str");
    String sedOid=(String)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 (evnOidPoses.containsKey(studySubjectLabel + sedOid)) {
      String[] poses=evnOidPoses.get(studySubjectLabel + sedOid).split("String_Node_Str");
      ExportStudyEventDataBean se=data.getExportSubjectData().get(Integer.parseInt(poses[0])).getExportStudyEventData().get(Integer.parseInt(poses[1]));
      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 == 17 || typeId == 18 || typeId == 19 || typeId == 20 || typeId == 21 || typeId == 22 || typeId == 23 || typeId == 31) {
        if ("String_Node_Str".equals(newValue)) {
          auditLog.setOldValue(SubjectEventStatus.INVALID.getName());
        }
 else {
          auditLog.setNewValue(SubjectEventStatus.getFromMap(Integer.parseInt(newValue)).getName());
        }
        if ("String_Node_Str".equals(oldValue)) {
          auditLog.setOldValue(SubjectEventStatus.INVALID.getName());
        }
 else {
          auditLog.setOldValue(SubjectEventStatus.getFromMap(Integer.parseInt(oldValue)).getName());
        }
      }
 else {
        auditLog.setNewValue(newValue);
        auditLog.setOldValue(oldValue);
      }
      AuditLogsBean logs=se.getAuditLogs();
      if (logs.getEntityID() == null || logs.getEntityID().length() <= 0) {
        logs.setEntityID(se.getStudyEventOID());
      }
      logs.getAuditLogs().add(auditLog);
      se.setAuditLogs(logs);
    }
  }
}

Fixed version (ground truth):
protected void setOCEventDataAuditLogs(StudyBean study,OdmClinicalDataBean data,String studySubjectOids,HashMap<String,String> evnOidPoses){
  this.setOCEventDataAuditsTypesExpected();
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + this.getOCEventDataAuditsSql(studySubjectOids));
  ArrayList rows=select(this.getOCEventDataAuditsSql(studySubjectOids));
  Iterator iter=rows.iterator();
  while (iter.hasNext()) {
    HashMap row=(HashMap)iter.next();
    String studySubjectLabel=(String)row.get("String_Node_Str");
    String sedOid=(String)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 (evnOidPoses.containsKey(studySubjectLabel + sedOid)) {
      String[] poses=evnOidPoses.get(studySubjectLabel + sedOid).split("String_Node_Str");
      ExportStudyEventDataBean se=data.getExportSubjectData().get(Integer.parseInt(poses[0])).getExportStudyEventData().get(Integer.parseInt(poses[1]));
      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 == 17 || typeId == 18 || typeId == 19 || typeId == 20 || typeId == 21 || typeId == 22 || typeId == 23 || typeId == 31) {
        if ("String_Node_Str".equals(newValue)) {
          auditLog.setOldValue(SubjectEventStatus.INVALID.getName());
        }
 else {
          auditLog.setNewValue(SubjectEventStatus.getFromMap(Integer.parseInt(newValue)).getName());
        }
        if ("String_Node_Str".equals(oldValue)) {
          auditLog.setOldValue(SubjectEventStatus.INVALID.getName());
        }
 else {
          auditLog.setOldValue(SubjectEventStatus.getFromMap(Integer.parseInt(oldValue)).getName());
        }
      }
 else {
        auditLog.setNewValue(newValue);
        auditLog.setOldValue(oldValue);
      }
      AuditLogsBean logs=se.getAuditLogs();
      if (logs.getEntityID() == null || logs.getEntityID().length() <= 0) {
        logs.setEntityID(se.getStudyEventOID());
      }
      logs.getAuditLogs().add(auditLog);
      se.setAuditLogs(logs);
    }
  }
}