Program: 115247
Project: 115247
Buggy source:
/** 
 * creation of sites: we have to parse the following. <ns2:studySite> <ns2:identifier xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:II" nullFlavor="NI" displayable="false"/> <ns2:statusCode xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:CD" code="ACTIVE"/> <ns2:organization> <ns2:description xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ST" nullFlavor="NI"/> <ns2:identifier xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:II" root="2.16.840.1.113883.3.26.7.10" extension="47012" identifierName="Clinical Connector Organization Identifier" displayable="false"/> <ns2:name xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ST" value="Duke-NUS Graduate Medical School Singapore"/> <ns2:postalAddress xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:AD" isNotOrdered="false"> <ns1:part value="2 Jalan Bukit Merah" type="SAL"/> <ns1:part value="Singapore" type="CTY"/> <ns1:part code="Singapore" type="CNT"/> </ns2:postalAddress> </ns2:organization> </ns2:studySite>
 * @param study
 * @param studyNode
 * @return
 */
public ArrayList<StudyBean> getSites(StudyBean study,Node studyNode) throws CCDataValidationFaultException {
  ArrayList<StudyBean> siteList=new ArrayList<StudyBean>();
  Element studyElement=(Element)studyNode;
  NodeList nlist=studyElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  System.out.println("String_Node_Str" + nlist.getLength() + "String_Node_Str");
  for (int j=0; j < nlist.getLength(); j++) {
    StudyBean site=new StudyBean();
    site.setParentStudyId(study.getId());
    site.setParentStudyName(study.getName());
    Node siteNode=nlist.item(j);
    Element siteElement=(Element)siteNode;
    String siteIdentifier=this.getElementValue(siteNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    NodeList orgNodeList=siteElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
    Node orgNode=orgNodeList.item(0);
    String summary=this.getElementValue(orgNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    site.setSummary(summary);
    String name=this.getElementValue(orgNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    site.setName(name);
    site.setFacilityName(name);
    String orgIdentifier=this.getElementValue(orgNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    site.setIdentifier(orgIdentifier);
    site=this.getPostalAddress(site,orgNode);
    siteList.add(site);
  }
  return siteList;
}

Fixed version (ground truth):
/** 
 * creation of sites: we have to parse the following. <ns2:studySite> <ns2:identifier xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:II" nullFlavor="NI" displayable="false"/> <ns2:statusCode xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:CD" code="ACTIVE"/> <ns2:organization> <ns2:description xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ST" nullFlavor="NI"/> <ns2:identifier xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:II" root="2.16.840.1.113883.3.26.7.10" extension="47012" identifierName="Clinical Connector Organization Identifier" displayable="false"/> <ns2:name xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ST" value="Duke-NUS Graduate Medical School Singapore"/> <ns2:postalAddress xmlns:ns1="uri:iso.org:21090" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:AD" isNotOrdered="false"> <ns1:part value="2 Jalan Bukit Merah" type="SAL"/> <ns1:part value="Singapore" type="CTY"/> <ns1:part code="Singapore" type="CNT"/> </ns2:postalAddress> </ns2:organization> </ns2:studySite>
 * @param study
 * @param studyNode
 * @return
 */
public ArrayList<StudyBean> getSites(StudyBean study,Node studyNode) throws CCDataValidationFaultException {
  ArrayList<StudyBean> siteList=new ArrayList<StudyBean>();
  Element studyElement=(Element)studyNode;
  NodeList nlist=studyElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
  System.out.println("String_Node_Str" + nlist.getLength() + "String_Node_Str");
  for (int j=0; j < nlist.getLength(); j++) {
    StudyBean site=new StudyBean();
    site.setParentStudyId(study.getId());
    site.setParentStudyName(study.getName());
    Node siteNode=nlist.item(j);
    Element siteElement=(Element)siteNode;
    NodeList orgNodeList=siteElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
    Node orgNode=orgNodeList.item(0);
    String summary=this.getElementValue(orgNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    site.setSummary(summary);
    String name=this.getElementValue(orgNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    site.setName(name);
    site.setFacilityName(name);
    String orgIdentifier=this.getElementValue(orgNode,CONNECTOR_NAMESPACE_V1,"String_Node_Str","String_Node_Str");
    site.setIdentifier(study.getIdentifier() + "String_Node_Str" + orgIdentifier);
    System.out.println("String_Node_Str" + site.getIdentifier());
    site=this.getPostalAddress(site,orgNode);
    siteList.add(site);
  }
  return siteList;
}