nus-yam/ex-repair huggingface dataset:
Program: 115256
Project: 115256
Buggy source:
public StudyBean generateStudyBean(UserAccountBean user,Node study){
  StudyBean studyBean=new StudyBean();
  studyBean.setOwner(user);
  DomParsingService xmlService=new DomParsingService();
  studyBean.setIdentifier(xmlService.getElementValue(study,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setStatus(Status.AVAILABLE);
  studyBean.setName(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setPhase(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setPurpose(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setSummary(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setSecondaryIdentifier(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  int enrollment=xmlService.getTargetAccrualNumberRange(study);
  studyBean.setExpectedTotalEnrollment(enrollment);
  System.out.println("String_Node_Str" + enrollment);
  studyBean=xmlService.getStudyInvestigator(studyBean,study);
  studyBean=xmlService.getStudyCenter(studyBean,study);
  studyBean=xmlService.getSponsorName(studyBean,study);
  return studyBean;
}

Fixed version (ground truth):
public StudyBean generateStudyBean(UserAccountBean user,Node study) throws Exception {
  StudyBean studyBean=new StudyBean();
  studyBean.setOwner(user);
  DomParsingService xmlService=new DomParsingService();
  studyBean.setIdentifier(xmlService.getElementValue(study,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setStatus(Status.AVAILABLE);
  studyBean.setName(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setPhase(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setPurpose(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setSummary(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  studyBean.setSecondaryIdentifier(xmlService.getElementValue(study,this.CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str"));
  int enrollment=xmlService.getTargetAccrualNumberRange(study);
  studyBean.setExpectedTotalEnrollment(enrollment);
  System.out.println("String_Node_Str" + enrollment);
  studyBean=xmlService.getStudyInvestigator(studyBean,study);
  studyBean=xmlService.getStudyCenter(studyBean,study);
  studyBean=xmlService.getSponsorName(studyBean,study);
  return studyBean;
}
Program: 115258
Project: 115258
Buggy source:
/** 
 * <ns2:identifier xmlns:ns1="uri:iso.org:21090" xsi:type="ns1:II" root="2.16.840.1.113883.3.26.7.8" extension="NC010" identifierName="Study Coordinating Center" displayable="false"/> <ns2:name xmlns:ns1="uri:iso.org:21090" xsi:type="ns1:ST" value="Duke University Medical Center"/> <ns2:postalAddress xmlns:ns1="uri:iso.org:21090" xsi:type="ns1:AD" isNotOrdered="false"> <ns1:part value="Durham" type="CTY"/> <ns1:part code="USA" type="CNT"/> <ns1:part code="NC" type="STA"/> </ns2:postalAddress>
 * @param study
 * @param studyNode
 * @return
 */
public StudyBean getStudyCenter(StudyBean study,Node studyNode){
  String facilityCity="String_Node_Str", facilityCountry="String_Node_Str", facilityName="String_Node_Str", facilityState="String_Node_Str";
  Element studyElement=(Element)studyNode;
  NodeList nlist=studyElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Node nlistNode=nlist.item(0);
  facilityName=this.getElementValue(nlistNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
  study.setFacilityName(facilityName);
  study=this.getPostalAddress(study,nlistNode);
  return study;
}

Fixed version (ground truth):
/** 
 * <ns2:identifier xmlns:ns1="uri:iso.org:21090" xsi:type="ns1:II" root="2.16.840.1.113883.3.26.7.8" extension="NC010" identifierName="Study Coordinating Center" displayable="false"/> <ns2:name xmlns:ns1="uri:iso.org:21090" xsi:type="ns1:ST" value="Duke University Medical Center"/> <ns2:postalAddress xmlns:ns1="uri:iso.org:21090" xsi:type="ns1:AD" isNotOrdered="false"> <ns1:part value="Durham" type="CTY"/> <ns1:part code="USA" type="CNT"/> <ns1:part code="NC" type="STA"/> </ns2:postalAddress>
 * @param study
 * @param studyNode
 * @return
 */
public StudyBean getStudyCenter(StudyBean study,Node studyNode) throws CCDataValidationFaultException {
  String facilityCity="String_Node_Str", facilityCountry="String_Node_Str", facilityName="String_Node_Str", facilityState="String_Node_Str";
  Element studyElement=(Element)studyNode;
  NodeList nlist=studyElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Node nlistNode=nlist.item(0);
  facilityName=this.getElementValue(nlistNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
  study.setFacilityName(facilityName);
  study=this.getPostalAddress(study,nlistNode);
  return study;
}
Program: 115259
Project: 115259
Buggy source:
/** 
 * get element value, generic parser for getting the value of an attribute in an XML line.
 * @param subject , our XML node.
 * @param namespace , our namespace, typically will be http://clinicalconnector.nci.nih.gov, but could also be ISO 21090
 * @param xmlLine , the xml line we want to parse
 * @param attrName , the attribute we want to grab, could be 'value' or 'code' or something generic like that
 * @return
 */
public String getElementValue(Node subject,String namespace,String xmlLine,String attrName){
  String ret="String_Node_Str";
  Element subjectElement=(Element)subject;
  NodeList xmlNode=subjectElement.getElementsByTagNameNS(namespace,xmlLine);
  Node xmlNodeValue=xmlNode.item(0);
  try {
    if (xmlNodeValue.hasAttributes()) {
      NamedNodeMap nodeMap=xmlNodeValue.getAttributes();
      Node nodeValue=nodeMap.getNamedItem(attrName);
      ret=nodeValue.getNodeValue();
    }
  }
 catch (  NullPointerException npe) {
    System.out.println("String_Node_Str");
    NamedNodeMap nodeMap=xmlNodeValue.getAttributes();
    Node nodeValue=nodeMap.getNamedItem("String_Node_Str");
    ret=nodeValue.getNodeValue();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * get element value, generic parser for getting the value of an attribute in an XML line.
 * @param subject , our XML node.
 * @param namespace , our namespace, typically will be http://clinicalconnector.nci.nih.gov, but could also be ISO 21090
 * @param xmlLine , the xml line we want to parse
 * @param attrName , the attribute we want to grab, could be 'value' or 'code' or something generic like that
 * @return
 */
public String getElementValue(Node subject,String namespace,String xmlLine,String attrName) throws CCDataValidationFaultException {
  String ret="String_Node_Str";
  try {
    Element subjectElement=(Element)subject;
    NodeList xmlNode=subjectElement.getElementsByTagNameNS(namespace,xmlLine);
    Node xmlNodeValue=xmlNode.item(0);
    try {
      if (xmlNodeValue.hasAttributes()) {
        NamedNodeMap nodeMap=xmlNodeValue.getAttributes();
        Node nodeValue=nodeMap.getNamedItem(attrName);
        ret=nodeValue.getNodeValue();
      }
    }
 catch (    NullPointerException npe) {
      System.out.println("String_Node_Str");
      NamedNodeMap nodeMap=xmlNodeValue.getAttributes();
      Node nodeValue=nodeMap.getNamedItem("String_Node_Str");
      ret=nodeValue.getNodeValue();
    }
  }
 catch (  Exception ee) {
    throw new CCDataValidationFaultException("String_Node_Str" + xmlLine + "String_Node_Str","String_Node_Str");
  }
  return ret;
}
Program: 115260
Project: 115260
Buggy source:
public StudyBean getSponsorName(StudyBean study,Node studyNode){
  String sponsorName="String_Node_Str";
  Element studyElement=(Element)studyNode;
  NodeList nlist=studyElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Node nlistNode=nlist.item(0);
  Element nlistNodeElement=(Element)nlistNode;
  NodeList nlist2=nlistNodeElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Node nameNode=nlist2.item(0);
  sponsorName=this.getElementValue(nameNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
  study.setSponsor(sponsorName);
  System.out.println("String_Node_Str" + sponsorName);
  return study;
}

Fixed version (ground truth):
public StudyBean getSponsorName(StudyBean study,Node studyNode) throws CCDataValidationFaultException {
  String sponsorName="String_Node_Str";
  Element studyElement=(Element)studyNode;
  NodeList nlist=studyElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Node nlistNode=nlist.item(0);
  Element nlistNodeElement=(Element)nlistNode;
  NodeList nlist2=nlistNodeElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Node nameNode=nlist2.item(0);
  sponsorName=this.getElementValue(nameNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
  study.setSponsor(sponsorName);
  System.out.println("String_Node_Str" + sponsorName);
  return study;
}
Program: 115262
Project: 115262
Buggy source:
protected Element invokeInternal(Element requestElement,Document document) throws Exception {
  System.out.println("String_Node_Str");
  return mapRegisterSubjectConfirmation("String_Node_Str");
}

Fixed version (ground truth):
protected Element invokeInternal(Element requestElement,Document document) throws Exception {
  System.out.println("String_Node_Str");
  NodeList nlist=requestElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  this.logNodeList(nlist);
  return mapRegisterSubjectConfirmation("String_Node_Str");
}
Program: 115263
Project: 115263
Buggy source:
protected Element invokeInternal(Element requestElement,Document document) throws Exception {
  System.out.println("String_Node_Str");
  return mapRegisterSubjectConfirmation("String_Node_Str");
}

Fixed version (ground truth):
protected Element invokeInternal(Element requestElement,Document document) throws Exception {
  System.out.println("String_Node_Str");
  NodeList nlist=requestElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  this.logNodeList(nlist);
  return mapRegisterSubjectConfirmation("String_Node_Str");
}
Program: 115266
Project: 115266
Buggy source:
private Element mapSubjectErrorConfirmation(String message) throws Exception {
  DocumentBuilderFactory dbfac=DocumentBuilderFactory.newInstance();
  DocumentBuilder docBuilder=dbfac.newDocumentBuilder();
  Document document=docBuilder.newDocument();
  Element responseElement=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Element indicator=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Attr typeAttr=document.createAttributeNS(XSL_NAMESPACE,"String_Node_Str");
  typeAttr.setNodeValue("String_Node_Str");
  indicator.setAttributeNode(typeAttr);
  indicator.setAttribute("String_Node_Str","String_Node_Str");
  responseElement.appendChild(indicator);
  Element errormessage=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Element code=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  code.setTextContent("String_Node_Str");
  errormessage.appendChild(code);
  Element reason=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  reason.setTextContent(message);
  errormessage.appendChild(reason);
  responseElement.appendChild(errormessage);
  return responseElement;
}

Fixed version (ground truth):
public Element mapSubjectErrorConfirmation(String message) throws Exception {
  DocumentBuilderFactory dbfac=DocumentBuilderFactory.newInstance();
  DocumentBuilder docBuilder=dbfac.newDocumentBuilder();
  Document document=docBuilder.newDocument();
  Element responseElement=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Element indicator=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Attr typeAttr=document.createAttributeNS(XSL_NAMESPACE,"String_Node_Str");
  typeAttr.setNodeValue("String_Node_Str");
  indicator.setAttributeNode(typeAttr);
  indicator.setAttribute("String_Node_Str","String_Node_Str");
  responseElement.appendChild(indicator);
  Element errormessage=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  Element code=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  code.setTextContent("String_Node_Str");
  errormessage.appendChild(code);
  Element reason=document.createElementNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  reason.setTextContent(message);
  errormessage.appendChild(reason);
  responseElement.appendChild(errormessage);
  return responseElement;
}
Program: 115267
Project: 115267
Buggy source:
public Map generateDiscNoteTotal(DataSource ds,StudyBean currentStudy,ListNotesFilter listNotesFilter){
  DiscrepancyNoteDAO discrepancyNoteDAO=new DiscrepancyNoteDAO(ds);
  Map<String,String> summaryMap=new HashMap<String,String>();
  int tempType=0;
  Set<String> p=TYPES.keySet();
  for (  String discNoteTypeName : p) {
    tempType=TYPES.get(discNoteTypeName);
    String tempTotal=discrepancyNoteDAO.getViewNotesCountWithFilter("String_Node_Str" + tempType + listNotesFilter.execute("String_Node_Str"),currentStudy).toString();
    summaryMap.put(discNoteTypeName,tempTotal.equals("String_Node_Str") ? "String_Node_Str" : tempTotal);
  }
  return summaryMap;
}

Fixed version (ground truth):
public Map generateDiscNoteTotal(ArrayList<DiscrepancyNoteBean> discList){
  Map<String,String> summaryMap=new HashMap<String,String>();
  int tempType=0;
  Set<String> p=TYPES.keySet();
  for (  String discNoteTypeName : p) {
    tempType=TYPES.get(discNoteTypeName);
    String tempTotal=countNotes(discList,0,tempType);
    summaryMap.put(discNoteTypeName,tempTotal.equals("String_Node_Str") ? "String_Node_Str" : tempTotal);
  }
  return summaryMap;
}
Program: 115269
Project: 115269
Buggy source:
public RollbackRegisterSubjectEndpoint(DataSource dataSource,MessageSource messages,CoreResources coreResources){
  this.dataSource=dataSource;
  this.messages=messages;
  this.coreResources=coreResources;
  this.locale=new Locale("String_Node_Str");
}

Fixed version (ground truth):
public RollbackRegisterSubjectEndpoint(DataSource dataSource,MessageSource messages,CoreResources coreResources){
  super(dataSource,messages,coreResources);
  this.subjectService=new RegisterSubjectService();
}
Program: 115270
Project: 115270
Buggy source:
@RequestMapping("String_Node_Str") public ModelMap viewAllSubjectHandler(HttpServletRequest request,@RequestParam("String_Node_Str") int studyId){
  ModelMap gridMap=new ModelMap();
  boolean showMoreLink=false;
  if (request.getParameter("String_Node_Str") != null) {
    showMoreLink=Boolean.parseBoolean(request.getParameter("String_Node_Str").toString());
  }
 else {
    showMoreLink=true;
  }
  request.setAttribute("String_Node_Str",showMoreLink + "String_Node_Str");
  request.setAttribute("String_Node_Str",studyId);
  Integer studySubjectId=(Integer)request.getAttribute("String_Node_Str");
  studySubjectId=(studySubjectId == null || studySubjectId == 0 ? 0 : studySubjectId);
  request.setAttribute("String_Node_Str",studySubjectId);
  ArrayList<String> pageMessages=(ArrayList<String>)request.getAttribute("String_Node_Str");
  if (pageMessages == null) {
    pageMessages=new ArrayList<String>();
  }
  request.setAttribute("String_Node_Str",pageMessages);
  String sdvMatrix=sdvUtil.renderEventCRFTableWithLimit(request,studyId,"String_Node_Str");
  gridMap.addAttribute(SUBJECT_SDV_TABLE_ATTRIBUTE,sdvMatrix);
  return gridMap;
}

Fixed version (ground truth):
@RequestMapping("String_Node_Str") public ModelMap viewAllSubjectHandler(HttpServletRequest request,@RequestParam("String_Node_Str") int studyId){
  ResourceBundleProvider.updateLocale(request.getLocale());
  ModelMap gridMap=new ModelMap();
  boolean showMoreLink=false;
  if (request.getParameter("String_Node_Str") != null) {
    showMoreLink=Boolean.parseBoolean(request.getParameter("String_Node_Str").toString());
  }
 else {
    showMoreLink=true;
  }
  request.setAttribute("String_Node_Str",showMoreLink + "String_Node_Str");
  request.setAttribute("String_Node_Str",studyId);
  Integer studySubjectId=(Integer)request.getAttribute("String_Node_Str");
  studySubjectId=(studySubjectId == null || studySubjectId == 0 ? 0 : studySubjectId);
  request.setAttribute("String_Node_Str",studySubjectId);
  ArrayList<String> pageMessages=(ArrayList<String>)request.getAttribute("String_Node_Str");
  if (pageMessages == null) {
    pageMessages=new ArrayList<String>();
  }
  request.setAttribute("String_Node_Str",pageMessages);
  String sdvMatrix=sdvUtil.renderEventCRFTableWithLimit(request,studyId,"String_Node_Str");
  gridMap.addAttribute(SUBJECT_SDV_TABLE_ATTRIBUTE,sdvMatrix);
  return gridMap;
}
Program: 115283
Project: 115283
Buggy source:
public static List getNotesForPrintPop(){
  return notesForPrintPop;
}

Fixed version (ground truth):
public static ArrayList getNotesForPrintPop(){
  return notesForPrintPop;
}
Program: 115284
Project: 115284
Buggy source:
public static void setNotesForPrintPop(List notesForPrintPop){
  ListNotesTableFactory.notesForPrintPop=notesForPrintPop;
}

Fixed version (ground truth):
public static void setNotesForPrintPop(ArrayList notesForPrintPop){
  ListNotesTableFactory.notesForPrintPop=notesForPrintPop;
}
Program: 115286
Project: 115286
Buggy source:
@Override protected void addToolbarItems(){
  addToolbarItem(ToolbarItemType.SEPARATOR);
  addToolbarItem(createCustomItem(new ShowMoreItem()));
  if (this.studyHasDiscNotes) {
    addToolbarItem(createDownloadLinkItem());
  }
  addToolbarItem(ToolbarItemType.SEPARATOR);
  addToolbarItem(createBackToNotesMatrixListItem());
  addToolbarItem(createCustomItem(new NewHiddenItem()));
}

Fixed version (ground truth):
@Override protected void addToolbarItems(){
  addToolbarItem(ToolbarItemType.SEPARATOR);
  addToolbarItem(createCustomItem(new ShowMoreItem()));
  if (this.studyHasDiscNotes) {
    addToolbarItem(createDownloadLinkItem());
  }
  addToolbarItem(createCustomItem(new NewHiddenItem()));
}
Program: 115291
Project: 115291
Buggy source:
@Override public String enabled(){
  HtmlBuilder html=new HtmlBuilder();
  html.a().href("String_Node_Str" + resolutionStatus + "String_Node_Str"+ discNoteType+ "String_Node_Str"+ module+ "String_Node_Str");
  html.quote();
  html.append(getAction());
  html.quote().close();
  html.img().name("String_Node_Str").src("String_Node_Str").border("String_Node_Str").alt(resword.getString("String_Node_Str")).title(resword.getString("String_Node_Str")).append("String_Node_Str").end().aEnd();
  return html.toString();
}

Fixed version (ground truth):
@Override public String enabled(){
  HtmlBuilder html=new HtmlBuilder();
  html.a().href("String_Node_Str");
  html.onclick("String_Node_Str");
  html.quote();
  html.append(getAction());
  html.quote().close();
  html.img().name("String_Node_Str").src("String_Node_Str").border("String_Node_Str").alt(resword.getString("String_Node_Str")).title(resword.getString("String_Node_Str")).append("String_Node_Str").end().aEnd();
  return html.toString();
}
Program: 115292
Project: 115292
Buggy source:
@Override protected void addToolbarItems(){
  addToolbarItem(ToolbarItemType.SEPARATOR);
  addToolbarItem(createCustomItem(new ShowMoreItem()));
  if (this.studyHasDiscNotes) {
    addToolbarItem(createDownloadLinkItem());
  }
  addToolbarItem(createCustomItem(new NewHiddenItem()));
}

Fixed version (ground truth):
@Override protected void addToolbarItems(){
  addToolbarItem(ToolbarItemType.SEPARATOR);
  addToolbarItem(createCustomItem(new ShowMoreItem()));
  if (this.studyHasDiscNotes) {
    addToolbarItem(createDownloadLinkItem());
    addToolbarItem(createNotePopupLinkItem());
  }
  addToolbarItem(createCustomItem(new NewHiddenItem()));
}
Program: 115294
Project: 115294
Buggy source:
@Override protected void processRequest() throws Exception {
  removeLockedCRF(ub.getId());
  FormProcessor fp=new FormProcessor(request);
  if (fp.getString("String_Node_Str").equals("String_Node_Str")) {
    showMoreLink=true;
  }
 else {
    showMoreLink=Boolean.parseBoolean(fp.getString("String_Node_Str"));
  }
  String idSetting=currentStudy.getStudyParameterConfig().getSubjectIdGeneration();
  if (idSetting.equals("String_Node_Str") || idSetting.equals("String_Node_Str")) {
    request.setAttribute("String_Node_Str",AUTO_LABEL);
  }
  request.setAttribute("String_Node_Str",true);
  if (fp.getString("String_Node_Str").equals("String_Node_Str") && fp.getString("String_Node_Str").trim().length() > 0) {
    StudySubjectBean studySubject=getStudySubjectDAO().findByLabelAndStudy(fp.getString("String_Node_Str"),currentStudy);
    if (studySubject.getId() > 0) {
      request.setAttribute("String_Node_Str",new Integer(studySubject.getId()).toString());
      forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
    }
 else {
      createTable();
    }
  }
 else {
    createTable();
  }
}

Fixed version (ground truth):
@Override protected void processRequest() throws Exception {
  removeLockedCRF(ub.getId());
  FormProcessor fp=new FormProcessor(request);
  if (fp.getString("String_Node_Str").equals("String_Node_Str")) {
    showMoreLink=true;
  }
 else {
    showMoreLink=Boolean.parseBoolean(fp.getString("String_Node_Str"));
  }
  String idSetting=currentStudy.getStudyParameterConfig().getSubjectIdGeneration();
  if (idSetting.equals("String_Node_Str") || idSetting.equals("String_Node_Str")) {
    request.setAttribute("String_Node_Str",AUTO_LABEL);
  }
  if (fp.getRequest().getParameter("String_Node_Str") == null) {
    Date today=new Date(System.currentTimeMillis());
    String todayFormatted=local_df.format(today);
    if (request.getAttribute(PRESET_VALUES) != null) {
      fp.setPresetValues((HashMap)request.getAttribute(PRESET_VALUES));
    }
    fp.addPresetValue(AddNewSubjectServlet.INPUT_ENROLLMENT_DATE,todayFormatted);
    fp.addPresetValue(AddNewSubjectServlet.INPUT_EVENT_START_DATE,todayFormatted);
    setPresetValues(fp.getPresetValues());
  }
  request.setAttribute("String_Node_Str",true);
  if (fp.getString("String_Node_Str").equals("String_Node_Str") && fp.getString("String_Node_Str").trim().length() > 0) {
    StudySubjectBean studySubject=getStudySubjectDAO().findByLabelAndStudy(fp.getString("String_Node_Str"),currentStudy);
    if (studySubject.getId() > 0) {
      request.setAttribute("String_Node_Str",new Integer(studySubject.getId()).toString());
      forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
    }
 else {
      createTable();
    }
  }
 else {
    createTable();
  }
}
Program: 115296
Project: 115296
Buggy source:
private File processUploadedFile(FileItem item,String dirToSaveUploadedFileIn) throws Exception {
  dirToSaveUploadedFileIn=dirToSaveUploadedFileIn == null ? System.getProperty("String_Node_Str") : dirToSaveUploadedFileIn;
  String fileName=item.getName();
  int startIndex=fileName.lastIndexOf('\\');
  if (startIndex != -1) {
    fileName=fileName.substring(startIndex + 1,fileName.length());
  }
  File uploadedFile=new File(dirToSaveUploadedFileIn + File.separator + fileName);
  if (fileRenamePolicy != null) {
    uploadedFile=fileRenamePolicy.rename(uploadedFile);
  }
  item.write(uploadedFile);
  return uploadedFile;
}

Fixed version (ground truth):
private File processUploadedFile(FileItem item,String dirToSaveUploadedFileIn){
  dirToSaveUploadedFileIn=dirToSaveUploadedFileIn == null ? System.getProperty("String_Node_Str") : dirToSaveUploadedFileIn;
  String fileName=item.getName();
  int startIndex=fileName.lastIndexOf('\\');
  if (startIndex != -1) {
    fileName=fileName.substring(startIndex + 1,fileName.length());
  }
  File uploadedFile=new File(dirToSaveUploadedFileIn + File.separator + fileName);
  if (fileRenamePolicy != null) {
    uploadedFile=fileRenamePolicy.rename(uploadedFile);
  }
  try {
    item.write(uploadedFile);
  }
 catch (  Exception e) {
    throw new OpenClinicaSystemException(e.getMessage());
  }
  return uploadedFile;
}
Program: 115297
Project: 115297
Buggy source:
@SuppressWarnings("String_Node_Str") private List<File> getFiles(HttpServletRequest request,ServletContext context,String dirToSaveUploadedFileIn){
  List<File> files=new ArrayList<File>();
  DiskFileItemFactory factory=new DiskFileItemFactory();
  ServletFileUpload upload=new ServletFileUpload(factory);
  try {
    List<FileItem> items=upload.parseRequest(request);
    Iterator<FileItem> iter=items.iterator();
    while (iter.hasNext()) {
      FileItem item=iter.next();
      if (item.isFormField()) {
        request.setAttribute(item.getFieldName(),item.getString());
      }
 else {
        files.add(processUploadedFile(item,dirToSaveUploadedFileIn));
      }
    }
    return files;
  }
 catch (  FileUploadException fue) {
    throw new OpenClinicaSystemException(fue.getMessage(),fue.getCause());
  }
catch (  Exception e) {
    throw new OpenClinicaSystemException(e.getMessage(),e.getCause());
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private List<File> getFiles(HttpServletRequest request,ServletContext context,String dirToSaveUploadedFileIn){
  List<File> files=new ArrayList<File>();
  DiskFileItemFactory factory=new DiskFileItemFactory();
  ServletFileUpload upload=new ServletFileUpload(factory);
  upload.setFileSizeMax(getFileProperties().getFileSizeMax());
  try {
    List<FileItem> items=upload.parseRequest(request);
    Iterator<FileItem> iter=items.iterator();
    while (iter.hasNext()) {
      FileItem item=iter.next();
      if (item.isFormField()) {
        request.setAttribute(item.getFieldName(),item.getString());
      }
 else {
        getFileProperties().isValidExtension(item.getName());
        files.add(processUploadedFile(item,dirToSaveUploadedFileIn));
      }
    }
    return files;
  }
 catch (  FileSizeLimitExceededException slee) {
    throw new OpenClinicaSystemException("String_Node_Str",new Object[]{String.valueOf(getFileProperties().getFileSizeMaxInMb())},slee.getMessage());
  }
catch (  FileUploadException fue) {
    throw new OpenClinicaSystemException("String_Node_Str",new Object[]{fue.getMessage()},fue.getMessage());
  }
}
Program: 115298
Project: 115298
Buggy source:
public OpenClinicaSystemException(String code,Object[] errorParams){
  this.errorCode=code;
  this.errorParams=errorParams;
}

Fixed version (ground truth):
public OpenClinicaSystemException(String code,Object[] errorParams,String message){
  this(message);
  this.errorCode=code;
  this.errorParams=errorParams;
}
Program: 115303
Project: 115303
Buggy source:
private void sendErrorEmail(String message,JobExecutionContext context){
  String subject="String_Node_Str" + message;
  String emailBody="String_Node_Str";
  try {
    ApplicationContext appContext=(ApplicationContext)context.getScheduler().getContext().get("String_Node_Str");
    mailSender=(OpenClinicaMailSender)appContext.getBean("String_Node_Str");
    mailSender.sendEmail(EmailEngine.getAdminEmail(),EmailEngine.getAdminEmail(),subject,emailBody,false);
  }
 catch (  SchedulerException se) {
    se.printStackTrace();
  }
catch (  OpenClinicaSystemException ose) {
    ose.printStackTrace();
  }
}

Fixed version (ground truth):
private void sendErrorEmail(String message,JobExecutionContext context,String target){
  String subject="String_Node_Str" + message;
  String emailBody="String_Node_Str";
  try {
    ApplicationContext appContext=(ApplicationContext)context.getScheduler().getContext().get("String_Node_Str");
    mailSender=(OpenClinicaMailSender)appContext.getBean("String_Node_Str");
    mailSender.sendEmail(target,EmailEngine.getAdminEmail(),subject,emailBody,false);
    System.out.println("String_Node_Str" + target + "String_Node_Str"+ EmailEngine.getAdminEmail());
  }
 catch (  SchedulerException se) {
    se.printStackTrace();
  }
catch (  OpenClinicaSystemException ose) {
    ose.printStackTrace();
  }
}
Program: 115315
Project: 115315
Buggy source:
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  int fileId=fp.getInt("String_Node_Str");
  ArchivedDatasetFileDAO asdfdao=new ArchivedDatasetFileDAO(sm.getDataSource());
  ArchivedDatasetFileBean asdfBean=(ArchivedDatasetFileBean)asdfdao.findByPK(fileId);
  Page finalTarget=Page.EXPORT_DATA_CUSTOM;
  if (asdfBean.getFileReference().endsWith("String_Node_Str")) {
    response.setContentType("String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str" + asdfBean.getName() + "String_Node_Str");
    response.setHeader("String_Node_Str","String_Node_Str");
  }
 else {
    response.setContentType("String_Node_Str");
  }
  finalTarget.setFileName("String_Node_Str");
  request.setAttribute("String_Node_Str",asdfBean.getFileReference());
  response.setHeader("String_Node_Str","String_Node_Str");
  forwardPage(finalTarget);
}

Fixed version (ground truth):
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  int fileId=fp.getInt("String_Node_Str");
  ArchivedDatasetFileDAO asdfdao=new ArchivedDatasetFileDAO(sm.getDataSource());
  ArchivedDatasetFileBean asdfBean=(ArchivedDatasetFileBean)asdfdao.findByPK(fileId);
  Page finalTarget=Page.EXPORT_DATA_CUSTOM;
  System.out.println("String_Node_Str" + asdfBean.getFileReference() + "String_Node_Str"+ asdfBean.getName());
  if (asdfBean.getFileReference().endsWith("String_Node_Str")) {
    response.setHeader("String_Node_Str","String_Node_Str" + asdfBean.getName() + "String_Node_Str");
    response.setContentType("String_Node_Str");
  }
 else   if (asdfBean.getFileReference().endsWith("String_Node_Str")) {
    response.setHeader("String_Node_Str","String_Node_Str" + asdfBean.getName() + "String_Node_Str");
    response.setContentType("String_Node_Str");
  }
 else   if (asdfBean.getFileReference().endsWith("String_Node_Str")) {
    response.setHeader("String_Node_Str","String_Node_Str" + asdfBean.getName() + "String_Node_Str");
    response.setContentType("String_Node_Str");
  }
 else   if (asdfBean.getFileReference().endsWith("String_Node_Str")) {
    response.setHeader("String_Node_Str","String_Node_Str" + asdfBean.getName() + "String_Node_Str");
    response.setContentType("String_Node_Str");
  }
 else   if (asdfBean.getFileReference().endsWith("String_Node_Str")) {
    response.setHeader("String_Node_Str","String_Node_Str" + asdfBean.getName() + "String_Node_Str");
    response.setContentType("String_Node_Str");
  }
 else {
  }
  System.out.println("String_Node_Str" + response.getContentType());
  finalTarget.setFileName("String_Node_Str");
  request.setAttribute("String_Node_Str",asdfBean.getFileReference());
  response.setHeader("String_Node_Str","String_Node_Str");
  forwardPage(finalTarget);
}
Program: 115322
Project: 115322
Buggy source:
public DynamicsMetadataService(DataSource ds){
  itemsAlreadyShown=new ArrayList<Integer>();
  this.ds=ds;
}

Fixed version (ground truth):
public DynamicsMetadataService(DataSource ds){
  this.ds=ds;
}
Program: 115325
Project: 115325
Buggy source:
public void validateAgainstSchema(File xmlFile,InputStream xsdFile){
  try {
    DocumentBuilder parser=DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document document=parser.parse(xmlFile);
    SchemaFactory factory=SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Source schemaFile=new StreamSource(xsdFile);
    Schema schema=factory.newSchema(schemaFile);
    Validator validator=schema.newValidator();
    validator.validate(new DOMSource(document));
  }
 catch (  FileNotFoundException ex) {
    throw new OpenClinicaSystemException("String_Node_Str",ex.getCause());
  }
catch (  IOException ioe) {
    throw new OpenClinicaSystemException("String_Node_Str",ioe.getCause());
  }
catch (  SAXParseException spe) {
    throw new OpenClinicaSystemException("String_Node_Str" + spe.getLineNumber() + "String_Node_Str"+ spe.getMessage(),spe.getCause());
  }
catch (  SAXException e) {
    throw new OpenClinicaSystemException(e.getMessage(),e.getCause());
  }
catch (  ParserConfigurationException pce) {
    throw new OpenClinicaSystemException(pce.getMessage(),pce.getCause());
  }
}

Fixed version (ground truth):
public void validateAgainstSchema(File xmlFile,InputStream xsdFile){
  try {
    DocumentBuilderFactory builderFactory=DocumentBuilderFactory.newInstance();
    builderFactory.setNamespaceAware(true);
    DocumentBuilder parser=builderFactory.newDocumentBuilder();
    Document document=parser.parse(xmlFile);
    SchemaFactory factory=SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Source schemaFile=new StreamSource(xsdFile);
    Schema schema=factory.newSchema(schemaFile);
    Validator validator=schema.newValidator();
    validator.validate(new DOMSource(document));
  }
 catch (  FileNotFoundException ex) {
    throw new OpenClinicaSystemException("String_Node_Str",ex.getCause());
  }
catch (  IOException ioe) {
    throw new OpenClinicaSystemException("String_Node_Str",ioe.getCause());
  }
catch (  SAXParseException spe) {
    throw new OpenClinicaSystemException("String_Node_Str" + spe.getLineNumber() + "String_Node_Str"+ spe.getMessage(),spe.getCause());
  }
catch (  SAXException e) {
    throw new OpenClinicaSystemException(e.getMessage(),e.getCause());
  }
catch (  ParserConfigurationException pce) {
    throw new OpenClinicaSystemException(pce.getMessage(),pce.getCause());
  }
}
Program: 115326
Project: 115326
Buggy source:
public ArrayList findAllByItemId(int itemId){
  ArrayList answer=new ArrayList();
  this.setTypesExpected();
  this.setTypeExpected(28,TypeNames.STRING);
  this.setTypeExpected(29,TypeNames.STRING);
  this.setTypeExpected(30,TypeNames.INT);
  this.setTypeExpected(31,TypeNames.STRING);
  HashMap variables=new HashMap();
  variables.put(new Integer(1),new Integer(itemId));
  String sql=digester.getQuery("String_Node_Str");
  ArrayList alist=this.select(sql,variables);
  Iterator it=alist.iterator();
  while (it.hasNext()) {
    HashMap hm=(HashMap)it.next();
    ItemFormMetadataBean ifmb=(ItemFormMetadataBean)this.getEntityFromHashMap(hm);
    String versionName=(String)hm.get("String_Node_Str");
    String groupLabel=(String)hm.get("String_Node_Str");
    String sectionName=(String)hm.get("String_Node_Str");
    int repeatMax=new Integer((Integer)hm.get("String_Node_Str")).intValue();
    ifmb.setCrfVersionName(versionName);
    ifmb.setGroupLabel(groupLabel);
    ifmb.setSectionName(sectionName);
    ifmb.setRepeatMax(repeatMax);
    answer.add(ifmb);
  }
  return answer;
}

Fixed version (ground truth):
public ArrayList findAllByItemId(int itemId){
  ArrayList answer=new ArrayList();
  this.setTypesExpected();
  this.setTypeExpected(29,TypeNames.STRING);
  this.setTypeExpected(30,TypeNames.STRING);
  this.setTypeExpected(31,TypeNames.INT);
  this.setTypeExpected(32,TypeNames.STRING);
  HashMap variables=new HashMap();
  variables.put(new Integer(1),new Integer(itemId));
  String sql=digester.getQuery("String_Node_Str");
  ArrayList alist=this.select(sql,variables);
  Iterator it=alist.iterator();
  while (it.hasNext()) {
    HashMap hm=(HashMap)it.next();
    ItemFormMetadataBean ifmb=(ItemFormMetadataBean)this.getEntityFromHashMap(hm);
    String versionName=(String)hm.get("String_Node_Str");
    String groupLabel=(String)hm.get("String_Node_Str");
    String sectionName=(String)hm.get("String_Node_Str");
    int repeatMax=new Integer((Integer)hm.get("String_Node_Str")).intValue();
    ifmb.setCrfVersionName(versionName);
    ifmb.setGroupLabel(groupLabel);
    ifmb.setSectionName(sectionName);
    ifmb.setRepeatMax(repeatMax);
    answer.add(ifmb);
  }
  return answer;
}
Program: 115327
Project: 115327
Buggy source:
public void setEventGroupItemDataWithUnitTypesExpected(){
  this.unsetTypeExpected();
  this.setTypeExpected(1,TypeNames.INT);
  this.setTypeExpected(2,TypeNames.INT);
  this.setTypeExpected(3,TypeNames.STRING);
  this.setTypeExpected(4,TypeNames.STRING);
  this.setTypeExpected(5,TypeNames.INT);
  this.setTypeExpected(6,TypeNames.STRING);
  this.setTypeExpected(7,TypeNames.INT);
  this.setTypeExpected(8,TypeNames.STRING);
  this.setTypeExpected(9,TypeNames.INT);
  this.setTypeExpected(10,TypeNames.INT);
  this.setTypeExpected(11,TypeNames.STRING);
}

Fixed version (ground truth):
public void setEventGroupItemDataWithUnitTypesExpected(){
  this.unsetTypeExpected();
  this.setTypeExpected(1,TypeNames.INT);
  this.setTypeExpected(2,TypeNames.INT);
  this.setTypeExpected(3,TypeNames.STRING);
  this.setTypeExpected(4,TypeNames.STRING);
  this.setTypeExpected(5,TypeNames.INT);
  this.setTypeExpected(6,TypeNames.STRING);
  this.setTypeExpected(7,TypeNames.INT);
  this.setTypeExpected(8,TypeNames.STRING);
  this.setTypeExpected(9,TypeNames.INT);
  this.setTypeExpected(10,TypeNames.STRING);
}
Program: 115329
Project: 115329
Buggy source:
public Map<String,String> mapAllChildAndParentNameInSection(Integer sectionId){
  Map<String,String> nameMap=new HashMap<String,String>();
  this.unsetTypeExpected();
  this.setTypeExpected(1,TypeNames.STRING);
  this.setTypeExpected(2,TypeNames.INT);
  this.setTypeExpected(3,TypeNames.STRING);
  this.setTypeExpected(4,TypeNames.INT);
  HashMap variables=new HashMap();
  variables.put(new Integer(1),new Integer(sectionId));
  String sql=digester.getQuery("String_Node_Str");
  ArrayList rows=select(sql,variables);
  Iterator it=rows.iterator();
  while (it.hasNext()) {
    HashMap row=(HashMap)it.next();
    String cn=(String)row.get("String_Node_Str");
    Integer cid=(Integer)row.get("String_Node_Str");
    String pn=(String)row.get("String_Node_Str");
    Integer pid=(Integer)row.get("String_Node_Str");
    nameMap.put(cn,pn);
  }
  return nameMap;
}

Fixed version (ground truth):
public Map<String,String> mapAllChildAndParentNameInSection(Integer sectionId){
  Map<String,String> nameMap=new HashMap<String,String>();
  this.unsetTypeExpected();
  this.setTypeExpected(1,TypeNames.STRING);
  this.setTypeExpected(2,TypeNames.INT);
  this.setTypeExpected(3,TypeNames.STRING);
  this.setTypeExpected(4,TypeNames.INT);
  HashMap variables=new HashMap();
  variables.put(new Integer(1),new Integer(sectionId));
  variables.put(new Integer(2),new Integer(sectionId));
  String sql=digester.getQuery("String_Node_Str");
  ArrayList rows=select(sql,variables);
  Iterator it=rows.iterator();
  while (it.hasNext()) {
    HashMap row=(HashMap)it.next();
    String cn=(String)row.get("String_Node_Str");
    Integer cid=(Integer)row.get("String_Node_Str");
    String pn=(String)row.get("String_Node_Str");
    Integer pid=(Integer)row.get("String_Node_Str");
    nameMap.put(cn,pn);
  }
  return nameMap;
}
Program: 115332
Project: 115332
Buggy source:
@Override public DynamicsItemFormMetadataBean saveOrUpdate(DynamicsItemFormMetadataBean domainObject){
  getCurrentSession().saveOrUpdate(domainObject);
  return domainObject;
}

Fixed version (ground truth):
@Override public DynamicsItemFormMetadataBean saveOrUpdate(DynamicsItemFormMetadataBean domainObject){
  getCurrentSession().saveOrUpdate(domainObject);
  getCurrentSession().flush();
  return domainObject;
}
Program: 115333
Project: 115333
Buggy source:
@Column(name="String_Node_Str",insertable=false) public Date getUpdatedDate(){
  return new Date();
}

Fixed version (ground truth):
@Column(name="String_Node_Str",insertable=false) public Date getUpdatedDate(){
  return updatedDate;
}
Program: 115334
Project: 115334
Buggy source:
protected void createStudyEvent(FormProcessor fp,StudySubjectBean s){
  int studyEventDefinitionId=fp.getInt("String_Node_Str");
  String location=fp.getString("String_Node_Str");
  Date startDate=s.getEventStartDate();
  if (studyEventDefinitionId > 0 && !StringUtil.isBlank(location)) {
    String locationTerm=resword.getString("String_Node_Str");
    if (location.equalsIgnoreCase(locationTerm)) {
      addPageMessage(restext.getString("String_Node_Str"));
    }
 else {
      logger.info("String_Node_Str");
      StudyEventDAO sedao=new StudyEventDAO(sm.getDataSource());
      StudyEventDefinitionDAO seddao=new StudyEventDefinitionDAO(sm.getDataSource());
      StudyEventBean se=new StudyEventBean();
      se.setLocation(location);
      se.setDateStarted(startDate);
      se.setDateEnded(startDate);
      se.setOwner(ub);
      se.setStudyEventDefinitionId(studyEventDefinitionId);
      se.setStatus(Status.AVAILABLE);
      se.setStudySubjectId(s.getId());
      se.setSubjectEventStatus(SubjectEventStatus.SCHEDULED);
      StudyEventDefinitionBean sed=(StudyEventDefinitionBean)seddao.findByPK(studyEventDefinitionId);
      se.setSampleOrdinal(sedao.getMaxSampleOrdinal(sed,s) + 1);
      sedao.create(se);
    }
  }
 else {
    addPageMessage(respage.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
protected void createStudyEvent(FormProcessor fp,StudySubjectBean s){
  int studyEventDefinitionId=fp.getInt("String_Node_Str");
  String location=fp.getString("String_Node_Str");
  Date startDate=s.getEventStartDate();
  if (studyEventDefinitionId > 0) {
    String locationTerm=resword.getString("String_Node_Str");
    if (location.equalsIgnoreCase(locationTerm)) {
      addPageMessage(restext.getString("String_Node_Str"));
    }
 else {
      logger.info("String_Node_Str");
      StudyEventDAO sedao=new StudyEventDAO(sm.getDataSource());
      StudyEventDefinitionDAO seddao=new StudyEventDefinitionDAO(sm.getDataSource());
      StudyEventBean se=new StudyEventBean();
      se.setLocation(location);
      se.setDateStarted(startDate);
      se.setDateEnded(startDate);
      se.setOwner(ub);
      se.setStudyEventDefinitionId(studyEventDefinitionId);
      se.setStatus(Status.AVAILABLE);
      se.setStudySubjectId(s.getId());
      se.setSubjectEventStatus(SubjectEventStatus.SCHEDULED);
      StudyEventDefinitionBean sed=(StudyEventDefinitionBean)seddao.findByPK(studyEventDefinitionId);
      se.setSampleOrdinal(sedao.getMaxSampleOrdinal(sed,s) + 1);
      sedao.create(se);
    }
  }
 else {
    addPageMessage(respage.getString("String_Node_Str"));
  }
}
Program: 115336
Project: 115336
Buggy source:
public String checkValidityOfItemOrItemGroupOidInCrf(String oid,RuleSetBean ruleSet){
  oid=oid.trim();
  String[] theOid=oid.split(ESCAPED_SEPERATOR);
  if (theOid.length == 2) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(theOid[0]);
    if (itemGroup != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
      ItemBean item=getItemDao().findItemByGroupIdandItemOid(itemGroup.getId(),theOid[1]);
      if (item != null) {
        return "String_Node_Str";
      }
    }
  }
  if (theOid.length == 1) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(oid);
    if (itemGroup != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
      return "String_Node_Str";
    }
    ItemBean item=getItemDao().findItemByGroupIdandItemOid(getItemGroupExpression(ruleSet.getTarget().getValue()).getId(),oid);
    if (item != null) {
      return "String_Node_Str";
    }
  }
  return oid;
}

Fixed version (ground truth):
public String checkValidityOfItemOrItemGroupOidInCrf(String oid,RuleSetBean ruleSet){
  oid=oid.trim();
  String[] theOid=oid.split(ESCAPED_SEPERATOR);
  if (theOid.length == 2) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(theOid[0]);
    if (itemGroup != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
      ItemBean item=getItemDao().findItemByGroupIdandItemOid(itemGroup.getId(),theOid[1]);
      if (item != null) {
        return "String_Node_Str";
      }
    }
  }
  if (theOid.length == 1) {
    ItemGroupBean itemGroup=getItemGroupDao().findByOid(oid);
    if (itemGroup != null && itemGroup.getCrfId().equals(ruleSet.getCrfId())) {
      return "String_Node_Str";
    }
    ItemBean item=getItemDao().findByOid(oid).get(0);
    if (item != null) {
      return "String_Node_Str";
    }
  }
  return oid;
}
Program: 115338
Project: 115338
Buggy source:
/** 
 * Save the discrepancy notes of each field into session in the form
 * @param field
 * @param notes
 * @param dndao
 * @param entityId
 * @param entityType
 * @param sb
 */
public static void saveFieldNotes(String field,FormDiscrepancyNotes notes,DiscrepancyNoteDAO dndao,int entityId,String entityType,StudyBean sb){
  if (notes == null || dndao == null || sb == null) {
    return;
  }
  ArrayList fieldNotes=notes.getNotes(field);
  System.out.println("String_Node_Str" + fieldNotes.size() + "String_Node_Str"+ field);
  for (int i=0; i < fieldNotes.size(); i++) {
    DiscrepancyNoteBean dnb=(DiscrepancyNoteBean)fieldNotes.get(i);
    dnb.setEntityId(entityId);
    dnb.setStudyId(sb.getId());
    dnb.setEntityType(entityType);
    if (dnb.getResolutionStatusId() == 0) {
      dnb.setResStatus(ResolutionStatus.NOT_APPLICABLE);
      dnb.setResolutionStatusId(ResolutionStatus.NOT_APPLICABLE.getId());
      if (!dnb.getDisType().equals(DiscrepancyNoteType.REASON_FOR_CHANGE)) {
        dnb.setResStatus(ResolutionStatus.OPEN);
        dnb.setResolutionStatusId(ResolutionStatus.OPEN.getId());
      }
    }
    dnb=(DiscrepancyNoteBean)dndao.create(dnb);
    dndao.createMapping(dnb);
    if (dnb.getParentDnId() == 0) {
      dnb.setParentDnId(dnb.getId());
      dnb=(DiscrepancyNoteBean)dndao.create(dnb);
      dndao.createMapping(dnb);
    }
  }
}

Fixed version (ground truth):
/** 
 * Save the discrepancy notes of each field into session in the form
 * @param field
 * @param notes
 * @param dndao
 * @param entityId
 * @param entityType
 * @param sb
 */
public static void saveFieldNotes(String field,FormDiscrepancyNotes notes,DiscrepancyNoteDAO dndao,int entityId,String entityType,StudyBean sb){
  if (notes == null || dndao == null || sb == null) {
    return;
  }
  ArrayList fieldNotes=notes.getNotes(field);
  for (int i=0; i < fieldNotes.size(); i++) {
    DiscrepancyNoteBean dnb=(DiscrepancyNoteBean)fieldNotes.get(i);
    dnb.setEntityId(entityId);
    dnb.setStudyId(sb.getId());
    dnb.setEntityType(entityType);
    if (dnb.getResolutionStatusId() == 0) {
      dnb.setResStatus(ResolutionStatus.NOT_APPLICABLE);
      dnb.setResolutionStatusId(ResolutionStatus.NOT_APPLICABLE.getId());
      if (!dnb.getDisType().equals(DiscrepancyNoteType.REASON_FOR_CHANGE)) {
        dnb.setResStatus(ResolutionStatus.OPEN);
        dnb.setResolutionStatusId(ResolutionStatus.OPEN.getId());
      }
    }
    dnb=(DiscrepancyNoteBean)dndao.create(dnb);
    dndao.createMapping(dnb);
    if (dnb.getParentDnId() == 0) {
      dnb.setParentDnId(dnb.getId());
      dnb=(DiscrepancyNoteBean)dndao.create(dnb);
      dndao.createMapping(dnb);
    }
  }
}
Program: 115339
Project: 115339
Buggy source:
public String execute(String criteria){
  String theCriteria="String_Node_Str";
  for (  Filter filter : filters) {
    theCriteria+=buildCriteria(criteria,filter.getProperty(),filter.getValue());
  }
  return theCriteria;
}

Fixed version (ground truth):
public String execute(String criteria){
  String theCriteria="String_Node_Str";
  for (  Filter filter : filters) {
    if (columnMapping.get(filter.getProperty()) == null) {
      continue;
    }
    theCriteria+=buildCriteria(criteria,filter.getProperty(),filter.getValue());
  }
  return theCriteria;
}