Program: 115288
Project: 115288
Buggy source:
public ArrayList<DiscrepancyNoteBean> findAllDiscrepancyNotesDataByStudy(StudyBean currentStudy){
  ArrayList<DiscrepancyNoteBean> discNotes=new ArrayList<DiscrepancyNoteBean>();
  setTypesExpected();
  this.setTypeExpected(12,TypeNames.STRING);
  HashMap variables=new HashMap();
  variables.put(new Integer(1),currentStudy.getId());
  variables.put(new Integer(2),currentStudy.getId());
  variables.put(new Integer(3),currentStudy.getId());
  variables.put(new Integer(4),currentStudy.getId());
  variables.put(new Integer(5),currentStudy.getId());
  variables.put(new Integer(6),currentStudy.getId());
  variables.put(new Integer(7),currentStudy.getId());
  variables.put(new Integer(8),currentStudy.getId());
  variables.put(new Integer(9),currentStudy.getId());
  variables.put(new Integer(10),currentStudy.getId());
  String sql=digester.getQuery("String_Node_Str");
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  if (currentStudy.isSite(currentStudy.getParentStudyId())) {
    sql+="String_Node_Str" + this.findSiteHiddenEventCrfIdsString(currentStudy) + "String_Node_Str";
  }
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  if (currentStudy.isSite(currentStudy.getParentStudyId())) {
    sql+="String_Node_Str" + this.findSiteHiddenEventCrfIdsString(currentStudy) + "String_Node_Str";
  }
  ArrayList rows=select(sql,variables);
  Iterator it=rows.iterator();
  while (it.hasNext()) {
    DiscrepancyNoteBean discBean=(DiscrepancyNoteBean)this.getEntityFromHashMap((HashMap)it.next());
    discBean=findSingleMapping(discBean);
    discNotes.add(discBean);
  }
  return discNotes;
}

Fixed version (ground truth):
public ArrayList<DiscrepancyNoteBean> findAllDiscrepancyNotesDataByStudy(StudyBean currentStudy){
  ArrayList<DiscrepancyNoteBean> discNotes=new ArrayList<DiscrepancyNoteBean>();
  setTypesExpected();
  this.setTypeExpected(12,TypeNames.STRING);
  this.setTypeExpected(13,TypeNames.INT);
  this.setTypeExpected(14,TypeNames.INT);
  HashMap variables=new HashMap();
  variables.put(new Integer(1),currentStudy.getId());
  variables.put(new Integer(2),currentStudy.getId());
  variables.put(new Integer(3),currentStudy.getId());
  variables.put(new Integer(4),currentStudy.getId());
  variables.put(new Integer(5),currentStudy.getId());
  variables.put(new Integer(6),currentStudy.getId());
  variables.put(new Integer(7),currentStudy.getId());
  variables.put(new Integer(8),currentStudy.getId());
  variables.put(new Integer(9),currentStudy.getId());
  variables.put(new Integer(10),currentStudy.getId());
  String sql=digester.getQuery("String_Node_Str");
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  if (currentStudy.isSite(currentStudy.getParentStudyId())) {
    sql+="String_Node_Str" + this.findSiteHiddenEventCrfIdsString(currentStudy) + "String_Node_Str";
  }
  sql+="String_Node_Str";
  sql+=digester.getQuery("String_Node_Str");
  if (currentStudy.isSite(currentStudy.getParentStudyId())) {
    sql+="String_Node_Str" + this.findSiteHiddenEventCrfIdsString(currentStudy) + "String_Node_Str";
  }
  ArrayList rows=select(sql,variables);
  Iterator it=rows.iterator();
  while (it.hasNext()) {
    DiscrepancyNoteBean discBean=(DiscrepancyNoteBean)this.getEntityFromHashMap((HashMap)it.next());
    discBean=findSingleMapping(discBean);
    discNotes.add(discBean);
  }
  return discNotes;
}