Program: 115169
Project: 115169
Buggy source:
@Override public void processRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
  FormProcessor fp=new FormProcessor(request);
  int eventCRFId=fp.getInt("String_Node_Str");
  EventCRFBean ecb=(EventCRFBean)request.getAttribute(INPUT_EVENT_CRF);
  SectionBean sb=(SectionBean)request.getAttribute(SECTION_BEAN);
  String isIE=fp.getString("String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(isIE)) {
    request.setAttribute("String_Node_Str","String_Node_Str");
  }
  int eventDefinitionCRFId=fp.getInt("String_Node_Str");
  SectionDAO sdao=new SectionDAO(getDataSource());
  CRFVersionDAO crfVersionDAO=new CRFVersionDAO(getDataSource());
  CRFDAO crfDao=new CRFDAO(getDataSource());
  ArrayList<SectionBean> allSectionBeans=new ArrayList<SectionBean>();
  ArrayList sectionBeans=new ArrayList();
  int crfVersionId=fp.getInt("String_Node_Str",true);
  boolean isSubmitted=false;
  if (crfVersionId == 0) {
    addPageMessage(respage.getString("String_Node_Str"),request);
    forwardPage(Page.CRF_LIST_SERVLET,request,response);
  }
 else {
    ItemGroupDAO itemGroupDao=new ItemGroupDAO(getDataSource());
    List<ItemGroupBean> itemGroupBeans=itemGroupDao.findOnlyGroupsByCRFVersionID(crfVersionId);
    if (itemGroupBeans.size() > 0) {
      DisplaySectionBeanHandler handler=new DisplaySectionBeanHandler(false,getDataSource(),getServletContext());
      handler.setCrfVersionId(crfVersionId);
      handler.setEventCRFId(eventCRFId);
      List<DisplaySectionBean> displaySectionBeans=handler.getDisplaySectionBeans();
      request.setAttribute("String_Node_Str",displaySectionBeans);
      CRFVersionBean crfverBean=(CRFVersionBean)crfVersionDAO.findByPK(crfVersionId);
      request.setAttribute("String_Node_Str",crfverBean);
      CRFBean crfBean=crfDao.findByVersionId(crfVersionId);
      request.setAttribute("String_Node_Str",crfBean);
      request.setAttribute("String_Node_Str","String_Node_Str");
      forwardPage(Page.VIEW_SECTION_DATA_ENTRY_PRINT_GROUPS,request,response);
      return;
    }
    ecb=new EventCRFBean();
    ecb.setCRFVersionId(crfVersionId);
    CRFVersionBean version=(CRFVersionBean)crfVersionDAO.findByPK(crfVersionId);
    ArrayList sects=(ArrayList)sdao.findByVersionId(version.getId());
    for (int i=0; i < sects.size(); i++) {
      sb=(SectionBean)sects.get(i);
      int sectId=sb.getId();
      if (sectId > 0) {
        allSectionBeans.add((SectionBean)sdao.findByPK(sectId));
      }
    }
    request.setAttribute(ALL_SECTION_BEANS,allSectionBeans);
    sectionBeans=super.getAllDisplayBeans(request);
  }
  request.setAttribute(INPUT_EVENT_CRF,ecb);
  request.setAttribute(SECTION_BEAN,sb);
  DisplaySectionBean dsb=super.getDisplayBean(false,false,request,isSubmitted);
  request.setAttribute("String_Node_Str",sectionBeans);
  request.setAttribute("String_Node_Str","String_Node_Str");
  request.setAttribute(BEAN_DISPLAY,dsb);
  request.setAttribute(BEAN_ANNOTATIONS,ecb.getAnnotations());
  request.setAttribute("String_Node_Str",sb);
  request.setAttribute("String_Node_Str",ecb);
  forwardPage(Page.VIEW_SECTION_DATA_ENTRY_PRINT,request,response);
}

Fixed version (ground truth):
@Override public void processRequest(HttpServletRequest request,HttpServletResponse response) throws Exception {
  FormProcessor fp=new FormProcessor(request);
  int eventCRFId=fp.getInt("String_Node_Str");
  EventCRFBean ecb=(EventCRFBean)request.getAttribute(INPUT_EVENT_CRF);
  SectionBean sb=(SectionBean)request.getAttribute(SECTION_BEAN);
  String isIE=fp.getString("String_Node_Str");
  if ("String_Node_Str".equalsIgnoreCase(isIE)) {
    request.setAttribute("String_Node_Str","String_Node_Str");
  }
  int eventDefinitionCRFId=fp.getInt("String_Node_Str");
  SectionDAO sdao=new SectionDAO(getDataSource());
  CRFVersionDAO crfVersionDAO=new CRFVersionDAO(getDataSource());
  CRFDAO crfDao=new CRFDAO(getDataSource());
  ArrayList<SectionBean> allSectionBeans=new ArrayList<SectionBean>();
  ArrayList sectionBeans=new ArrayList();
  int crfVersionId=fp.getInt("String_Node_Str",true);
  boolean isSubmitted=false;
  if (crfVersionId == 0) {
    addPageMessage(respage.getString("String_Node_Str"),request);
    forwardPage(Page.CRF_LIST_SERVLET,request,response);
  }
 else {
    ItemGroupDAO itemGroupDao=new ItemGroupDAO(getDataSource());
    List<ItemGroupBean> itemGroupBeans=itemGroupDao.findOnlyGroupsByCRFVersionID(crfVersionId);
    if (itemGroupBeans.size() > 0) {
      DisplaySectionBeanHandler handler=new DisplaySectionBeanHandler(false,getDataSource(),getServletContext());
      handler.setCrfVersionId(crfVersionId);
      handler.setEventCRFId(eventCRFId);
      List<DisplaySectionBean> displaySectionBeans=handler.getDisplaySectionBeans();
      request.setAttribute("String_Node_Str",displaySectionBeans);
      CRFVersionBean crfverBean=(CRFVersionBean)crfVersionDAO.findByPK(crfVersionId);
      request.setAttribute("String_Node_Str",crfverBean);
      CRFBean crfBean=crfDao.findByVersionId(crfVersionId);
      request.setAttribute("String_Node_Str",crfBean);
      request.setAttribute("String_Node_Str","String_Node_Str");
      forwardPage(Page.VIEW_SECTION_DATA_ENTRY_PRINT_GROUPS,request,response);
      return;
    }
    ecb=new EventCRFBean();
    ecb.setCRFVersionId(crfVersionId);
    CRFVersionBean version=(CRFVersionBean)crfVersionDAO.findByPK(crfVersionId);
    ArrayList sects=(ArrayList)sdao.findByVersionId(version.getId());
    for (int i=0; i < sects.size(); i++) {
      sb=(SectionBean)sects.get(i);
      int sectId=sb.getId();
      if (sectId > 0) {
        allSectionBeans.add((SectionBean)sdao.findByPK(sectId));
      }
    }
    request.setAttribute(ALL_SECTION_BEANS,allSectionBeans);
    request.setAttribute(INPUT_EVENT_CRF,ecb);
    sectionBeans=super.getAllDisplayBeans(request);
  }
  request.setAttribute(INPUT_EVENT_CRF,ecb);
  request.setAttribute(SECTION_BEAN,sb);
  DisplaySectionBean dsb=super.getDisplayBean(false,false,request,isSubmitted);
  request.setAttribute("String_Node_Str",sectionBeans);
  request.setAttribute("String_Node_Str","String_Node_Str");
  request.setAttribute(BEAN_DISPLAY,dsb);
  request.setAttribute(BEAN_ANNOTATIONS,ecb.getAnnotations());
  request.setAttribute("String_Node_Str",sb);
  request.setAttribute("String_Node_Str",ecb);
  forwardPage(Page.VIEW_SECTION_DATA_ENTRY_PRINT,request,response);
}