Program: 115135
Project: 115135
Buggy source:
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  int crfVersionId=fp.getInt("String_Node_Str",true);
  String action=fp.getString("String_Node_Str");
  String module=fp.getString(MODULE);
  request.setAttribute(MODULE,module);
  if (crfVersionId == 0) {
    addPageMessage(respage.getString("String_Node_Str"));
    forwardPage(Page.CRF_LIST_SERVLET);
    return;
  }
  CRFVersionDAO cvdao=new CRFVersionDAO(sm.getDataSource());
  CRFDAO cdao=new CRFDAO(sm.getDataSource());
  CRFVersionBean version=(CRFVersionBean)cvdao.findByPK(crfVersionId);
  CRFBean crf=(CRFBean)cdao.findByPK(version.getCrfId());
  if (!ub.isSysAdmin() && (version.getOwnerId() != ub.getId())) {
    addPageMessage(respage.getString("String_Node_Str") + "String_Node_Str" + respage.getString("String_Node_Str"));
    forwardPage(Page.MENU_SERVLET);
    return;
  }
  EventCRFDAO ecdao=new EventCRFDAO(sm.getDataSource());
  ArrayList eventCRFs=ecdao.findAllStudySubjectByCRFVersion(crfVersionId);
  if (StringUtil.isBlank(action)) {
    request.setAttribute("String_Node_Str",version);
    request.setAttribute("String_Node_Str",crf);
    request.setAttribute("String_Node_Str",eventCRFs);
    forwardPage(Page.CONFIRM_LOCKING_CRF_VERSION);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(action)) {
    version.setStatus(Status.LOCKED);
    version.setUpdater(ub);
    cvdao.update(version);
    ArrayList versionList=(ArrayList)cvdao.findAllByCRF(version.getCrfId());
    if (versionList.size() > 0) {
      EventDefinitionCRFDAO edCRFDao=new EventDefinitionCRFDAO(sm.getDataSource());
      ArrayList edcList=(ArrayList)edCRFDao.findAllByCRF(version.getCrfId());
      for (int i=0; i < edcList.size(); i++) {
        EventDefinitionCRFBean edcBean=(EventDefinitionCRFBean)edcList.get(i);
        RemoveCRFVersionServlet.updateEventDef(edcBean,edCRFDao,versionList);
      }
    }
    addPageMessage(respage.getString("String_Node_Str"));
    forwardPage(Page.CRF_LIST_SERVLET);
  }
}

Fixed version (ground truth):
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  int crfVersionId=fp.getInt("String_Node_Str",true);
  String action=fp.getString("String_Node_Str");
  String module=fp.getString(MODULE);
  request.setAttribute(MODULE,module);
  if (crfVersionId == 0) {
    addPageMessage(respage.getString("String_Node_Str"));
    forwardPage(Page.CRF_LIST_SERVLET);
    return;
  }
  CRFVersionDAO cvdao=new CRFVersionDAO(sm.getDataSource());
  CRFDAO cdao=new CRFDAO(sm.getDataSource());
  CRFVersionBean version=(CRFVersionBean)cvdao.findByPK(crfVersionId);
  CRFBean crf=(CRFBean)cdao.findByPK(version.getCrfId());
  if (!ub.isSysAdmin() && (version.getOwnerId() != ub.getId())) {
    addPageMessage(respage.getString("String_Node_Str") + "String_Node_Str" + respage.getString("String_Node_Str"));
    forwardPage(Page.MENU_SERVLET);
    return;
  }
  EventCRFDAO ecdao=new EventCRFDAO(sm.getDataSource());
  ArrayList eventCRFs=ecdao.findAllStudySubjectByCRFVersion(crfVersionId);
  if (StringUtil.isBlank(action)) {
    request.setAttribute("String_Node_Str",version);
    request.setAttribute("String_Node_Str",crf);
    request.setAttribute("String_Node_Str",eventCRFs);
    forwardPage(Page.CONFIRM_LOCKING_CRF_VERSION);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(action)) {
    version.setStatus(Status.LOCKED);
    version.setUpdater(ub);
    cvdao.update(version);
    ArrayList versionList=(ArrayList)cvdao.findAllByCRF(version.getCrfId());
    if (versionList.size() > 0) {
      EventDefinitionCRFDAO edCRFDao=new EventDefinitionCRFDAO(sm.getDataSource());
      ArrayList edcList=(ArrayList)edCRFDao.findAllByCRF(version.getCrfId());
      for (int i=0; i < edcList.size(); i++) {
        EventDefinitionCRFBean edcBean=(EventDefinitionCRFBean)edcList.get(i);
        RemoveCRFVersionServlet.updateEventDef(edcBean,edCRFDao,versionList,crfVersionId);
      }
    }
    addPageMessage(respage.getString("String_Node_Str"));
    forwardPage(Page.CRF_LIST_SERVLET);
  }
}