Program: 115261
Project: 115261
Buggy source:
protected Element invokeInternal(Element requestElement,Document document) throws Exception {
  System.out.println("String_Node_Str");
  StudyBean studyBean=new StudyBean();
  studyBean.setIdentifier("String_Node_Str");
  try {
    NodeList nlist=requestElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
    this.logNodeList(nlist);
    for (int i=0; i < nlist.getLength(); i++) {
      Node study=nlist.item(i);
      studyBean=studyService.generateStudyBean(getUserAccount(),study);
      StudyBean testStudyBean=getStudyDao().findByUniqueIdentifier(studyBean.getIdentifier());
      if (testStudyBean != null) {
        throw new CCBusinessFaultException("String_Node_Str" + studyBean.getIdentifier() + "String_Node_Str","String_Node_Str");
      }
      studyBean=this.generateStudyParameters(studyBean);
      studyBean=(StudyBean)getStudyDao().create(studyBean);
      ArrayList<StudyBean> sites=studyService.generateSites(getUserAccount(),studyBean,study);
      for (      StudyBean site : sites) {
        ArrayList<StudyParamsConfig> parentConfigs=studyBean.getStudyParameters();
        site.setStudyParameters(parentConfigs);
        site=(StudyBean)getStudyDao().create(site);
      }
    }
    return mapCreateStudyConfirmation(studyBean.getIdentifier());
  }
 catch (  Exception npe) {
    npe.printStackTrace();
    if (npe.getClass().getName().startsWith("String_Node_Str")) {
      System.out.println("String_Node_Str" + npe.getClass().getName());
      OpenClinicaException ope=(OpenClinicaException)npe;
      return mapStudyErrorConfirmation("String_Node_Str",ope);
    }
 else {
      System.out.println("String_Node_Str" + npe.getClass().getName());
      return mapStudyErrorConfirmation(npe.getMessage());
    }
  }
}

Fixed version (ground truth):
protected Element invokeInternal(Element requestElement,Document document) throws Exception {
  System.out.println("String_Node_Str");
  StudyBean studyBean=new StudyBean();
  studyBean.setIdentifier("String_Node_Str");
  try {
    NodeList nlist=requestElement.getElementsByTagNameNS(CONNECTOR_NAMESPACE_V1,"String_Node_Str");
    this.logNodeList(nlist);
    for (int i=0; i < nlist.getLength(); i++) {
      Node study=nlist.item(i);
      studyBean=studyService.generateStudyBean(getUserAccount(),study);
      StudyBean testStudyBean=getStudyDao().findByUniqueIdentifier(studyBean.getIdentifier());
      if (testStudyBean != null) {
        throw new CCBusinessFaultException("String_Node_Str" + studyBean.getIdentifier() + "String_Node_Str","String_Node_Str");
      }
      StudyConfigService configService=new StudyConfigService(dataSource);
      studyBean=configService.setParametersForStudy(studyBean);
      studyBean.getStudyParameterConfig().setSubjectIdGeneration("String_Node_Str");
      studyBean=(StudyBean)getStudyDao().create(studyBean);
      studyBean=this.createStudyParameters(studyBean);
      ArrayList<StudyBean> sites=studyService.generateSites(getUserAccount(),studyBean,study);
      for (      StudyBean site : sites) {
        site=configService.setParametersForSite(site);
        site.getStudyParameterConfig().setSubjectIdGeneration("String_Node_Str");
        site=(StudyBean)getStudyDao().create(site);
        site=this.createStudyParameters(site);
      }
    }
    return mapCreateStudyConfirmation(studyBean.getIdentifier());
  }
 catch (  Exception npe) {
    npe.printStackTrace();
    if (npe.getClass().getName().startsWith("String_Node_Str")) {
      System.out.println("String_Node_Str" + npe.getClass().getName());
      OpenClinicaException ope=(OpenClinicaException)npe;
      return mapStudyErrorConfirmation("String_Node_Str",ope);
    }
 else {
      System.out.println("String_Node_Str" + npe.getClass().getName());
      return mapStudyErrorConfirmation(npe.getMessage());
    }
  }
}