Program: 115171
Project: 115171
Buggy source:
private ArrayList<String> processData(File[] dest,DataSource dataSource,ResourceBundle respage,UserAccountBean ub,StudyBean studyBean,File destDirectory,TriggerBean triggerBean) throws Exception {
  StringBuffer msg=new StringBuffer();
  StringBuffer auditMsg=new StringBuffer();
  Mapping myMap=new Mapping();
  String propertiesPath=CoreResources.PROPERTIES_DIR;
  File xsdFile=new File(propertiesPath + File.separator + "String_Node_Str");
  File xsdFile2=new File(propertiesPath + File.separator + "String_Node_Str");
  boolean fail=false;
  myMap.loadMapping(propertiesPath + File.separator + "String_Node_Str");
  Unmarshaller um1=new Unmarshaller(myMap);
  ODMContainer odmContainer=new ODMContainer();
  for (  File f : dest) {
    String regex="String_Node_Str";
    String replacement="String_Node_Str";
    String startDirectory=destDirectory + File.separator + f.getName().replaceAll(regex,replacement)+ "String_Node_Str";
    String pattern="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
    SimpleDateFormat sdfDir=new SimpleDateFormat(pattern);
    String generalFileDir=sdfDir.format(new java.util.Date());
    File logDestDirectory=new File(destDirectory + File.separator + generalFileDir+ f.getName().replaceAll(regex,replacement)+ "String_Node_Str");
    if (!logDestDirectory.isDirectory()) {
      System.out.println("String_Node_Str" + logDestDirectory.getAbsolutePath());
      logDestDirectory.mkdirs();
    }
    File newFile=new File(logDestDirectory,"String_Node_Str");
    BufferedWriter out=new BufferedWriter(new FileWriter(newFile));
    if (f != null) {
      String firstLine="String_Node_Str" + f.getName() + "String_Node_Str";
      msg.append(firstLine);
      out.write(firstLine);
      auditMsg.append(firstLine);
    }
 else {
      msg.append("String_Node_Str" + respage.getString("String_Node_Str") + "String_Node_Str");
      out.write("String_Node_Str" + respage.getString("String_Node_Str") + "String_Node_Str");
      auditMsg.append("String_Node_Str" + respage.getString("String_Node_Str") + "String_Node_Str");
    }
    try {
      odmContainer=(ODMContainer)um1.unmarshal(new FileReader(f));
      System.out.println("String_Node_Str" + odmContainer.getCrfDataPostImportContainer().getStudyOID());
      System.out.println("String_Node_Str" + odmContainer.getCrfDataPostImportContainer().getSubjectData().size());
    }
 catch (    Exception me1) {
      System.out.println("String_Node_Str");
      try {
        schemaValidator.validateAgainstSchema(f,xsdFile2);
        odmContainer=(ODMContainer)um1.unmarshal(new FileReader(f));
      }
 catch (      Exception me2) {
        MessageFormat mf=new MessageFormat("String_Node_Str");
        mf.applyPattern(respage.getString("String_Node_Str"));
        Object[] arguments={me1.getMessage()};
        msg.append(mf.format(arguments) + "String_Node_Str");
        auditMsg.append(mf.format(arguments) + "String_Node_Str");
        System.out.println("String_Node_Str" + msg.toString());
        continue;
      }
    }
    List<String> errors=getImportCRFDataService(dataSource).validateStudyMetadata(odmContainer,studyBean.getId());
    if (errors != null) {
      System.out.println(errors.toString());
      if (errors.size() > 0) {
        out.write("String_Node_Str");
        for (        String error : errors) {
          out.write(error + "String_Node_Str");
        }
        out.write("String_Node_Str");
        MessageFormat mf=new MessageFormat("String_Node_Str");
        mf.applyPattern(respage.getString("String_Node_Str"));
        Object[] arguments={f.getName(),errors.size()};
        auditMsg.append(mf.format(arguments) + "String_Node_Str");
        msg.append(mf.format(arguments) + "String_Node_Str");
        auditMsg.append("String_Node_Str" + SQLInitServlet.getField("String_Node_Str") + "String_Node_Str"+ generalFileDir+ f.getName()+ "String_Node_Str"+ triggerBean.getName()+ "String_Node_Str");
        msg.append("String_Node_Str" + SQLInitServlet.getField("String_Node_Str") + "String_Node_Str"+ generalFileDir+ f.getName()+ "String_Node_Str"+ triggerBean.getName()+ "String_Node_Str");
        out.close();
        continue;
      }
 else {
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      }
    }
    List<EventCRFBean> eventCRFBeans=getImportCRFDataService(dataSource).fetchEventCRFBeans(odmContainer,ub);
    ArrayList<Integer> permittedEventCRFIds=new ArrayList<Integer>();
    System.out.println("String_Node_Str" + eventCRFBeans.toString());
    List<DisplayItemBeanWrapper> displayItemBeanWrappers=new ArrayList<DisplayItemBeanWrapper>();
    HashMap<String,String> totalValidationErrors=new HashMap<String,String>();
    HashMap<String,String> hardValidationErrors=new HashMap<String,String>();
    if (!eventCRFBeans.isEmpty()) {
      for (      EventCRFBean eventCRFBean : eventCRFBeans) {
        DataEntryStage dataEntryStage=eventCRFBean.getStage();
        Status eventCRFStatus=eventCRFBean.getStatus();
        System.out.println("String_Node_Str" + eventCRFBean.getId() + "String_Node_Str"+ dataEntryStage.getName()+ "String_Node_Str"+ eventCRFStatus.getName());
        if (eventCRFStatus.equals(Status.AVAILABLE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE)|| dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE)|| dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
          permittedEventCRFIds.add(new Integer(eventCRFBean.getId()));
        }
 else {
          MessageFormat mf=new MessageFormat("String_Node_Str");
          mf.applyPattern(respage.getString("String_Node_Str"));
          Object[] arguments={f.getName()};
          msg.append(mf.format(arguments) + "String_Node_Str");
          auditMsg.append(mf.format(arguments) + "String_Node_Str");
          out.write(mf.format(arguments) + "String_Node_Str");
          out.close();
          continue;
        }
      }
      if (eventCRFBeans.size() >= permittedEventCRFIds.size()) {
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      }
 else {
        fail=true;
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      }
      MockHttpServletRequest request=new MockHttpServletRequest();
      request.addPreferredLocale(locale);
      try {
        List<DisplayItemBeanWrapper> tempDisplayItemBeanWrappers=new ArrayList<DisplayItemBeanWrapper>();
        tempDisplayItemBeanWrappers=getImportCRFDataService(dataSource).lookupValidationErrors(request,odmContainer,ub,totalValidationErrors,hardValidationErrors,permittedEventCRFIds);
        System.out.println("String_Node_Str" + totalValidationErrors.size());
        displayItemBeanWrappers.addAll(tempDisplayItemBeanWrappers);
      }
 catch (      NullPointerException npe1) {
        npe1.printStackTrace();
        fail=true;
        System.out.println("String_Node_Str");
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        out.write(respage.getString("String_Node_Str") + "String_Node_Str");
        System.out.println("String_Node_Str");
      }
catch (      OpenClinicaException oce1) {
        fail=true;
        System.out.println("String_Node_Str" + oce1.getOpenClinicaMessage());
        msg.append(oce1.getOpenClinicaMessage() + "String_Node_Str");
        out.write(oce1.getOpenClinicaMessage() + "String_Node_Str");
        System.out.println("String_Node_Str");
      }
    }
 else {
      msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      out.write(respage.getString("String_Node_Str") + "String_Node_Str");
      out.close();
      continue;
    }
    ArrayList<SubjectDataBean> subjectData=odmContainer.getCrfDataPostImportContainer().getSubjectData();
    if (!hardValidationErrors.isEmpty()) {
      String messageHardVals=triggerService.generateHardValidationErrorMessage(subjectData,hardValidationErrors,false);
      out.write(messageHardVals);
    }
 else {
      if (!totalValidationErrors.isEmpty()) {
        String totalValErrors=triggerService.generateHardValidationErrorMessage(subjectData,totalValidationErrors,false);
        out.write(totalValErrors);
      }
      String validMsgs=triggerService.generateValidMessage(subjectData,totalValidationErrors);
      out.write(validMsgs);
    }
    out.close();
    if (fail) {
      MessageFormat mf=new MessageFormat("String_Node_Str");
      mf.applyPattern(respage.getString("String_Node_Str"));
      Object[] arguments={f.getName(),msg.toString()};
      msg.append(mf.format(arguments) + "String_Node_Str");
      out.close();
      continue;
    }
 else {
      msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      System.out.println("String_Node_Str" + totalValidationErrors.size());
      SummaryStatsBean ssBean=getImportCRFDataService(dataSource).generateSummaryStatsBean(odmContainer,displayItemBeanWrappers);
      msg.append(triggerService.generateSummaryStatsMessage(ssBean,respage) + "String_Node_Str");
      CrfBusinessLogicHelper crfBusinessLogicHelper=new CrfBusinessLogicHelper(dataSource);
      for (      DisplayItemBeanWrapper wrapper : displayItemBeanWrappers) {
        int eventCrfBeanId=-1;
        EventCRFBean eventCrfBean=new EventCRFBean();
        System.out.println("String_Node_Str" + wrapper.isSavable());
        if (wrapper.isSavable()) {
          ArrayList<Integer> eventCrfInts=new ArrayList<Integer>();
          System.out.println("String_Node_Str" + wrapper.getValidationErrors().toString());
          for (          DisplayItemBean displayItemBean : wrapper.getDisplayItemBeans()) {
            eventCrfBeanId=displayItemBean.getData().getEventCRFId();
            eventCrfBean=(EventCRFBean)eventCrfDao.findByPK(eventCrfBeanId);
            System.out.println("String_Node_Str" + displayItemBean.getData().getValue());
            System.out.println("String_Node_Str" + eventCrfBean.getStatus().getName());
            ItemDataBean itemDataBean=new ItemDataBean();
            itemDataBean=itemDataDao.findByItemIdAndEventCRFIdAndOrdinal(displayItemBean.getItem().getId(),eventCrfBean.getId(),displayItemBean.getData().getOrdinal());
            if (wrapper.isOverwrite() && itemDataBean.getStatus() != null) {
              System.out.println("String_Node_Str" + displayItemBean.getItem().getName());
              itemDataBean.setUpdatedDate(new Date());
              itemDataBean.setUpdater(ub);
              itemDataBean.setValue(displayItemBean.getData().getValue());
              itemDataDao.update(itemDataBean);
              System.out.println("String_Node_Str" + itemDataBean.getItemId());
              displayItemBean.getData().setId(itemDataBean.getId());
            }
 else {
              itemDataDao.create(displayItemBean.getData());
              System.out.println("String_Node_Str" + displayItemBean.getData().getItemId());
              ItemDataBean itemDataBean2=itemDataDao.findByItemIdAndEventCRFIdAndOrdinal(displayItemBean.getItem().getId(),eventCrfBean.getId(),displayItemBean.getData().getOrdinal());
              System.out.println("String_Node_Str" + itemDataBean2.getId() + "String_Node_Str"+ itemDataBean2.getName());
              displayItemBean.getData().setId(itemDataBean2.getId());
            }
            ItemDAO idao=new ItemDAO(dataSource);
            ItemBean ibean=(ItemBean)idao.findByPK(displayItemBean.getData().getItemId());
            System.out.println("String_Node_Str" + ibean.getName());
            String itemOid=displayItemBean.getItem().getOid() + "String_Node_Str" + wrapper.getStudyEventRepeatKey()+ "String_Node_Str"+ displayItemBean.getData().getOrdinal()+ "String_Node_Str"+ wrapper.getStudySubjectOid();
            if (wrapper.getValidationErrors().containsKey(itemOid)) {
              ArrayList messageList=(ArrayList)wrapper.getValidationErrors().get(itemOid);
              for (int iter=0; iter < messageList.size(); iter++) {
                String message=(String)messageList.get(iter);
                DiscrepancyNoteBean parentDn=createDiscrepancyNote(ibean,message,eventCrfBean,displayItemBean,null,ub,dataSource,studyBean);
                createDiscrepancyNote(ibean,message,eventCrfBean,displayItemBean,parentDn.getId(),ub,dataSource,studyBean);
                System.out.println("String_Node_Str" + message);
              }
            }
            if (!eventCrfInts.contains(new Integer(eventCrfBean.getId()))) {
              crfBusinessLogicHelper.markCRFComplete(eventCrfBean,ub);
              System.out.println("String_Node_Str" + eventCrfBean.getId());
              eventCrfInts.add(new Integer(eventCrfBean.getId()));
            }
          }
        }
      }
      msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      String linkMessage=respage.getString("String_Node_Str") + SQLInitServlet.getField("String_Node_Str") + respage.getString("String_Node_Str")+ SQLInitServlet.getField("String_Node_Str")+ respage.getString("String_Node_Str")+ generalFileDir+ f.getName()+ "String_Node_Str"+ triggerBean.getFullName()+ "String_Node_Str"+ respage.getString("String_Node_Str")+ "String_Node_Str";
      msg.append(linkMessage);
      auditMsg.append(linkMessage);
    }
  }
  ArrayList<String> retList=new ArrayList<String>();
  retList.add(msg.toString());
  retList.add(auditMsg.toString());
  return retList;
}

Fixed version (ground truth):
private ArrayList<String> processData(File[] dest,DataSource dataSource,ResourceBundle respage,UserAccountBean ub,StudyBean studyBean,File destDirectory,TriggerBean triggerBean) throws Exception {
  StringBuffer msg=new StringBuffer();
  StringBuffer auditMsg=new StringBuffer();
  Mapping myMap=new Mapping();
  String propertiesPath=CoreResources.PROPERTIES_DIR;
  File xsdFile=new File(propertiesPath + File.separator + "String_Node_Str");
  File xsdFile2=new File(propertiesPath + File.separator + "String_Node_Str");
  boolean fail=false;
  String ODM_MAPPING_DIR_path=CoreResources.ODM_MAPPING_DIR;
  myMap.loadMapping(ODM_MAPPING_DIR_path + File.separator + "String_Node_Str");
  Unmarshaller um1=new Unmarshaller(myMap);
  ODMContainer odmContainer=new ODMContainer();
  for (  File f : dest) {
    String regex="String_Node_Str";
    String replacement="String_Node_Str";
    String startDirectory=destDirectory + File.separator + f.getName().replaceAll(regex,replacement)+ "String_Node_Str";
    String pattern="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
    SimpleDateFormat sdfDir=new SimpleDateFormat(pattern);
    String generalFileDir=sdfDir.format(new java.util.Date());
    File logDestDirectory=new File(destDirectory + File.separator + generalFileDir+ f.getName().replaceAll(regex,replacement)+ "String_Node_Str");
    if (!logDestDirectory.isDirectory()) {
      System.out.println("String_Node_Str" + logDestDirectory.getAbsolutePath());
      logDestDirectory.mkdirs();
    }
    File newFile=new File(logDestDirectory,"String_Node_Str");
    BufferedWriter out=new BufferedWriter(new FileWriter(newFile));
    if (f != null) {
      String firstLine="String_Node_Str" + f.getName() + "String_Node_Str";
      msg.append(firstLine);
      out.write(firstLine);
      auditMsg.append(firstLine);
    }
 else {
      msg.append("String_Node_Str" + respage.getString("String_Node_Str") + "String_Node_Str");
      out.write("String_Node_Str" + respage.getString("String_Node_Str") + "String_Node_Str");
      auditMsg.append("String_Node_Str" + respage.getString("String_Node_Str") + "String_Node_Str");
    }
    try {
      odmContainer=(ODMContainer)um1.unmarshal(new FileReader(f));
      System.out.println("String_Node_Str" + odmContainer.getCrfDataPostImportContainer().getStudyOID());
      System.out.println("String_Node_Str" + odmContainer.getCrfDataPostImportContainer().getSubjectData().size());
    }
 catch (    Exception me1) {
      System.out.println("String_Node_Str");
      try {
        schemaValidator.validateAgainstSchema(f,xsdFile2);
        odmContainer=(ODMContainer)um1.unmarshal(new FileReader(f));
      }
 catch (      Exception me2) {
        MessageFormat mf=new MessageFormat("String_Node_Str");
        mf.applyPattern(respage.getString("String_Node_Str"));
        Object[] arguments={me1.getMessage()};
        msg.append(mf.format(arguments) + "String_Node_Str");
        auditMsg.append(mf.format(arguments) + "String_Node_Str");
        System.out.println("String_Node_Str" + msg.toString());
        continue;
      }
    }
    List<String> errors=getImportCRFDataService(dataSource).validateStudyMetadata(odmContainer,studyBean.getId());
    if (errors != null) {
      System.out.println(errors.toString());
      if (errors.size() > 0) {
        out.write("String_Node_Str");
        for (        String error : errors) {
          out.write(error + "String_Node_Str");
        }
        out.write("String_Node_Str");
        MessageFormat mf=new MessageFormat("String_Node_Str");
        mf.applyPattern(respage.getString("String_Node_Str"));
        Object[] arguments={f.getName(),errors.size()};
        auditMsg.append(mf.format(arguments) + "String_Node_Str");
        msg.append(mf.format(arguments) + "String_Node_Str");
        auditMsg.append("String_Node_Str" + SQLInitServlet.getField("String_Node_Str") + "String_Node_Str"+ generalFileDir+ f.getName()+ "String_Node_Str"+ triggerBean.getName()+ "String_Node_Str");
        msg.append("String_Node_Str" + SQLInitServlet.getField("String_Node_Str") + "String_Node_Str"+ generalFileDir+ f.getName()+ "String_Node_Str"+ triggerBean.getName()+ "String_Node_Str");
        out.close();
        continue;
      }
 else {
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      }
    }
    List<EventCRFBean> eventCRFBeans=getImportCRFDataService(dataSource).fetchEventCRFBeans(odmContainer,ub);
    ArrayList<Integer> permittedEventCRFIds=new ArrayList<Integer>();
    System.out.println("String_Node_Str" + eventCRFBeans.toString());
    List<DisplayItemBeanWrapper> displayItemBeanWrappers=new ArrayList<DisplayItemBeanWrapper>();
    HashMap<String,String> totalValidationErrors=new HashMap<String,String>();
    HashMap<String,String> hardValidationErrors=new HashMap<String,String>();
    if (!eventCRFBeans.isEmpty()) {
      for (      EventCRFBean eventCRFBean : eventCRFBeans) {
        DataEntryStage dataEntryStage=eventCRFBean.getStage();
        Status eventCRFStatus=eventCRFBean.getStatus();
        System.out.println("String_Node_Str" + eventCRFBean.getId() + "String_Node_Str"+ dataEntryStage.getName()+ "String_Node_Str"+ eventCRFStatus.getName());
        if (eventCRFStatus.equals(Status.AVAILABLE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE)|| dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE)|| dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
          permittedEventCRFIds.add(new Integer(eventCRFBean.getId()));
        }
 else {
          MessageFormat mf=new MessageFormat("String_Node_Str");
          mf.applyPattern(respage.getString("String_Node_Str"));
          Object[] arguments={f.getName()};
          msg.append(mf.format(arguments) + "String_Node_Str");
          auditMsg.append(mf.format(arguments) + "String_Node_Str");
          out.write(mf.format(arguments) + "String_Node_Str");
          out.close();
          continue;
        }
      }
      if (eventCRFBeans.size() >= permittedEventCRFIds.size()) {
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      }
 else {
        fail=true;
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      }
      MockHttpServletRequest request=new MockHttpServletRequest();
      request.addPreferredLocale(locale);
      try {
        List<DisplayItemBeanWrapper> tempDisplayItemBeanWrappers=new ArrayList<DisplayItemBeanWrapper>();
        tempDisplayItemBeanWrappers=getImportCRFDataService(dataSource).lookupValidationErrors(request,odmContainer,ub,totalValidationErrors,hardValidationErrors,permittedEventCRFIds);
        System.out.println("String_Node_Str" + totalValidationErrors.size());
        displayItemBeanWrappers.addAll(tempDisplayItemBeanWrappers);
      }
 catch (      NullPointerException npe1) {
        npe1.printStackTrace();
        fail=true;
        System.out.println("String_Node_Str");
        msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
        out.write(respage.getString("String_Node_Str") + "String_Node_Str");
        System.out.println("String_Node_Str");
      }
catch (      OpenClinicaException oce1) {
        fail=true;
        System.out.println("String_Node_Str" + oce1.getOpenClinicaMessage());
        msg.append(oce1.getOpenClinicaMessage() + "String_Node_Str");
        out.write(oce1.getOpenClinicaMessage() + "String_Node_Str");
        System.out.println("String_Node_Str");
      }
    }
 else {
      msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      out.write(respage.getString("String_Node_Str") + "String_Node_Str");
      out.close();
      continue;
    }
    ArrayList<SubjectDataBean> subjectData=odmContainer.getCrfDataPostImportContainer().getSubjectData();
    if (!hardValidationErrors.isEmpty()) {
      String messageHardVals=triggerService.generateHardValidationErrorMessage(subjectData,hardValidationErrors,false);
      out.write(messageHardVals);
    }
 else {
      if (!totalValidationErrors.isEmpty()) {
        String totalValErrors=triggerService.generateHardValidationErrorMessage(subjectData,totalValidationErrors,false);
        out.write(totalValErrors);
      }
      String validMsgs=triggerService.generateValidMessage(subjectData,totalValidationErrors);
      out.write(validMsgs);
    }
    out.close();
    if (fail) {
      MessageFormat mf=new MessageFormat("String_Node_Str");
      mf.applyPattern(respage.getString("String_Node_Str"));
      Object[] arguments={f.getName(),msg.toString()};
      msg.append(mf.format(arguments) + "String_Node_Str");
      out.close();
      continue;
    }
 else {
      msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      System.out.println("String_Node_Str" + totalValidationErrors.size());
      SummaryStatsBean ssBean=getImportCRFDataService(dataSource).generateSummaryStatsBean(odmContainer,displayItemBeanWrappers);
      msg.append(triggerService.generateSummaryStatsMessage(ssBean,respage) + "String_Node_Str");
      CrfBusinessLogicHelper crfBusinessLogicHelper=new CrfBusinessLogicHelper(dataSource);
      for (      DisplayItemBeanWrapper wrapper : displayItemBeanWrappers) {
        int eventCrfBeanId=-1;
        EventCRFBean eventCrfBean=new EventCRFBean();
        System.out.println("String_Node_Str" + wrapper.isSavable());
        if (wrapper.isSavable()) {
          ArrayList<Integer> eventCrfInts=new ArrayList<Integer>();
          System.out.println("String_Node_Str" + wrapper.getValidationErrors().toString());
          for (          DisplayItemBean displayItemBean : wrapper.getDisplayItemBeans()) {
            eventCrfBeanId=displayItemBean.getData().getEventCRFId();
            eventCrfBean=(EventCRFBean)eventCrfDao.findByPK(eventCrfBeanId);
            System.out.println("String_Node_Str" + displayItemBean.getData().getValue());
            System.out.println("String_Node_Str" + eventCrfBean.getStatus().getName());
            ItemDataBean itemDataBean=new ItemDataBean();
            itemDataBean=itemDataDao.findByItemIdAndEventCRFIdAndOrdinal(displayItemBean.getItem().getId(),eventCrfBean.getId(),displayItemBean.getData().getOrdinal());
            if (wrapper.isOverwrite() && itemDataBean.getStatus() != null) {
              System.out.println("String_Node_Str" + displayItemBean.getItem().getName());
              itemDataBean.setUpdatedDate(new Date());
              itemDataBean.setUpdater(ub);
              itemDataBean.setValue(displayItemBean.getData().getValue());
              itemDataDao.update(itemDataBean);
              System.out.println("String_Node_Str" + itemDataBean.getItemId());
              displayItemBean.getData().setId(itemDataBean.getId());
            }
 else {
              itemDataDao.create(displayItemBean.getData());
              System.out.println("String_Node_Str" + displayItemBean.getData().getItemId());
              ItemDataBean itemDataBean2=itemDataDao.findByItemIdAndEventCRFIdAndOrdinal(displayItemBean.getItem().getId(),eventCrfBean.getId(),displayItemBean.getData().getOrdinal());
              System.out.println("String_Node_Str" + itemDataBean2.getId() + "String_Node_Str"+ itemDataBean2.getName());
              displayItemBean.getData().setId(itemDataBean2.getId());
            }
            ItemDAO idao=new ItemDAO(dataSource);
            ItemBean ibean=(ItemBean)idao.findByPK(displayItemBean.getData().getItemId());
            System.out.println("String_Node_Str" + ibean.getName());
            String itemOid=displayItemBean.getItem().getOid() + "String_Node_Str" + wrapper.getStudyEventRepeatKey()+ "String_Node_Str"+ displayItemBean.getData().getOrdinal()+ "String_Node_Str"+ wrapper.getStudySubjectOid();
            if (wrapper.getValidationErrors().containsKey(itemOid)) {
              ArrayList messageList=(ArrayList)wrapper.getValidationErrors().get(itemOid);
              for (int iter=0; iter < messageList.size(); iter++) {
                String message=(String)messageList.get(iter);
                DiscrepancyNoteBean parentDn=createDiscrepancyNote(ibean,message,eventCrfBean,displayItemBean,null,ub,dataSource,studyBean);
                createDiscrepancyNote(ibean,message,eventCrfBean,displayItemBean,parentDn.getId(),ub,dataSource,studyBean);
                System.out.println("String_Node_Str" + message);
              }
            }
            if (!eventCrfInts.contains(new Integer(eventCrfBean.getId()))) {
              crfBusinessLogicHelper.markCRFComplete(eventCrfBean,ub);
              System.out.println("String_Node_Str" + eventCrfBean.getId());
              eventCrfInts.add(new Integer(eventCrfBean.getId()));
            }
          }
        }
      }
      msg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      auditMsg.append(respage.getString("String_Node_Str") + "String_Node_Str");
      String linkMessage=respage.getString("String_Node_Str") + SQLInitServlet.getField("String_Node_Str") + respage.getString("String_Node_Str")+ SQLInitServlet.getField("String_Node_Str")+ respage.getString("String_Node_Str")+ generalFileDir+ f.getName()+ "String_Node_Str"+ triggerBean.getFullName()+ "String_Node_Str"+ respage.getString("String_Node_Str")+ "String_Node_Str";
      msg.append(linkMessage);
      auditMsg.append(linkMessage);
    }
  }
  ArrayList<String> retList=new ArrayList<String>();
  retList.add(msg.toString());
  retList.add(auditMsg.toString());
  return retList;
}