Program: 115211
Project: 115211
Buggy source:
protected void setOCEventDataDNs(OdmClinicalDataBean data,String definitionOids,String studySubjectOids,HashMap<String,String> evnOidPoses){
  this.setOCEventDataDNsTypesExpected();
  HashMap<String,ArrayList<ChildNoteBean>> pDNs=new HashMap<String,ArrayList<ChildNoteBean>>();
  HashMap<String,ArrayList<DiscrepancyNoteBean>> sDNs=new HashMap<String,ArrayList<DiscrepancyNoteBean>>();
  logger.debug("String_Node_Str");
  logger.error("String_Node_Str" + this.getOCEventDataDNsSql(definitionOids,studySubjectOids));
  ArrayList rows=select(this.getOCEventDataDNsSql(definitionOids,studySubjectOids));
  Iterator iter=rows.iterator();
  while (iter.hasNext()) {
    HashMap row=(HashMap)iter.next();
    String studySubjectLabel=(String)row.get("String_Node_Str");
    String defOid=(String)row.get("String_Node_Str");
    Integer pdnId=(Integer)row.get("String_Node_Str");
    Integer dnId=(Integer)row.get("String_Node_Str");
    String description=(String)row.get("String_Node_Str");
    String detailedNote=(String)row.get("String_Node_Str");
    Integer ownerId=(Integer)row.get("String_Node_Str");
    Date dateCreated=(Date)row.get("String_Node_Str");
    String status=(String)row.get("String_Node_Str");
    String noteType=(String)row.get("String_Node_Str");
    String oidKey=studySubjectLabel + defOid;
    if (pdnId != null && pdnId > 0) {
      String key=oidKey + pdnId;
      ChildNoteBean cn=new ChildNoteBean();
      cn.setDateCreated(dateCreated);
      cn.setDescription(description);
      cn.setDetailedNote(detailedNote);
      cn.setStatus(status);
      cn.setOid("String_Node_Str" + dnId);
      ElementRefBean userRef=new ElementRefBean();
      userRef.setElementDefOID("String_Node_Str" + ownerId);
      cn.setUserRef(userRef);
      ArrayList<ChildNoteBean> cns=pDNs.containsKey(key) ? pDNs.get(key) : new ArrayList<ChildNoteBean>();
      cns.add(cn);
      pDNs.put(key,cns);
    }
 else {
      DiscrepancyNoteBean dn=new DiscrepancyNoteBean();
      String k=oidKey + dnId;
      if (pDNs != null && pDNs.containsKey(k)) {
        dn.setChildNotes(pDNs.get(k));
        dn.setNumberOfChildNotes(dn.getChildNotes().size());
      }
      dn.setDateUpdated(dateCreated);
      dn.setNoteType(noteType);
      dn.setStatus(status);
      dn.setOid("String_Node_Str" + dnId);
      ElementRefBean userRef=new ElementRefBean();
      userRef.setElementDefOID("String_Node_Str" + ownerId);
      if (evnOidPoses.containsKey(oidKey)) {
        String[] poses=evnOidPoses.get(oidKey).split("String_Node_Str");
        int p0=Integer.parseInt(poses[0]);
        int p1=Integer.parseInt(poses[1]);
        String entityID=data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getStudyEventOID();
        data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getDiscrepancyNotes().setEntityID(entityID);
        data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getDiscrepancyNotes().getDiscrepancyNotes().add(dn);
      }
    }
  }
}

Fixed version (ground truth):
protected void setOCEventDataDNs(OdmClinicalDataBean data,String definitionOids,String studySubjectOids,HashMap<String,String> evnOidPoses){
  this.setOCEventDataDNsTypesExpected();
  HashMap<String,ArrayList<ChildNoteBean>> pDNs=new HashMap<String,ArrayList<ChildNoteBean>>();
  HashMap<String,ArrayList<DiscrepancyNoteBean>> sDNs=new HashMap<String,ArrayList<DiscrepancyNoteBean>>();
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + this.getOCEventDataDNsSql(definitionOids,studySubjectOids));
  ArrayList rows=select(this.getOCEventDataDNsSql(definitionOids,studySubjectOids));
  Iterator iter=rows.iterator();
  while (iter.hasNext()) {
    HashMap row=(HashMap)iter.next();
    String studySubjectLabel=(String)row.get("String_Node_Str");
    String defOid=(String)row.get("String_Node_Str");
    Integer pdnId=(Integer)row.get("String_Node_Str");
    Integer dnId=(Integer)row.get("String_Node_Str");
    String description=(String)row.get("String_Node_Str");
    String detailedNote=(String)row.get("String_Node_Str");
    Integer ownerId=(Integer)row.get("String_Node_Str");
    Date dateCreated=(Date)row.get("String_Node_Str");
    String status=(String)row.get("String_Node_Str");
    String noteType=(String)row.get("String_Node_Str");
    String oidKey=studySubjectLabel + defOid;
    if (pdnId != null && pdnId > 0) {
      String key=oidKey + pdnId;
      ChildNoteBean cn=new ChildNoteBean();
      cn.setDateCreated(dateCreated);
      cn.setDescription(description);
      cn.setDetailedNote(detailedNote);
      cn.setStatus(status);
      cn.setOid("String_Node_Str" + dnId);
      ElementRefBean userRef=new ElementRefBean();
      userRef.setElementDefOID("String_Node_Str" + ownerId);
      cn.setUserRef(userRef);
      ArrayList<ChildNoteBean> cns=pDNs.containsKey(key) ? pDNs.get(key) : new ArrayList<ChildNoteBean>();
      cns.add(cn);
      pDNs.put(key,cns);
    }
 else {
      DiscrepancyNoteBean dn=new DiscrepancyNoteBean();
      String k=oidKey + dnId;
      if (pDNs != null && pDNs.containsKey(k)) {
        dn.setChildNotes(pDNs.get(k));
        dn.setNumberOfChildNotes(dn.getChildNotes().size());
      }
      dn.setDateUpdated(dateCreated);
      dn.setNoteType(noteType);
      dn.setStatus(status);
      dn.setOid("String_Node_Str" + dnId);
      ElementRefBean userRef=new ElementRefBean();
      userRef.setElementDefOID("String_Node_Str" + ownerId);
      if (evnOidPoses.containsKey(oidKey)) {
        String[] poses=evnOidPoses.get(oidKey).split("String_Node_Str");
        int p0=Integer.parseInt(poses[0]);
        int p1=Integer.parseInt(poses[1]);
        String entityID=data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getStudyEventOID();
        data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getDiscrepancyNotes().setEntityID(entityID);
        data.getExportSubjectData().get(p0).getExportStudyEventData().get(p1).getDiscrepancyNotes().getDiscrepancyNotes().add(dn);
      }
    }
  }
}