Program: 115015
Project: 115015
Buggy source:
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  ub.incNumVisitsToMainMenu();
  session.setAttribute(USER_BEAN_NAME,ub);
  request.setAttribute("String_Node_Str",true);
  request.setAttribute("String_Node_Str",false);
  if (ub == null || ub.getId() == 0) {
    forwardPage(Page.MENU,false);
    return;
  }
  UserAccountDAO udao=new UserAccountDAO(sm.getDataSource());
  UserAccountBean ub1=(UserAccountBean)udao.findByPK(ub.getId());
  processSpecificStudyEnvUuid(request,ub1);
  ub1.setLastVisitDate(new Date(System.currentTimeMillis()));
  ub1.setOwner(ub1);
  ub1.setUpdater(ub1);
  udao.update(ub1);
  if (currentStudy != null) {
    request.setAttribute("String_Node_Str",currentStudy.getId());
    request.setAttribute("String_Node_Str",super.getEventDefinitionsByCurrentStudy());
    request.setAttribute("String_Node_Str",super.getStudyGroupClassesByCurrentStudy());
  }
  logger.info("String_Node_Str" + ub.isLdapUser());
  if (currentStudy == null) {
    forwardPage(Page.MENU);
    return;
  }
  if (ub.getNumVisitsToMainMenu() <= 1) {
    if (ub.getLastVisitDate() != null) {
      addPageMessage(respage.getString("String_Node_Str") + "String_Node_Str" + ub.getFirstName()+ "String_Node_Str"+ ub.getLastName()+ "String_Node_Str"+ respage.getString("String_Node_Str")+ "String_Node_Str"+ local_df.format(ub.getLastVisitDate())+ "String_Node_Str");
    }
 else {
      addPageMessage(respage.getString("String_Node_Str") + "String_Node_Str" + ub.getFirstName()+ "String_Node_Str"+ ub.getLastName()+ "String_Node_Str");
    }
    if (currentStudy.getStatus().isLocked()) {
      addPageMessage(respage.getString("String_Node_Str"));
    }
 else     if (currentStudy.getStatus().isFrozen()) {
      addPageMessage(respage.getString("String_Node_Str"));
    }
  }
  Integer assignedDiscrepancies=getDiscrepancyNoteDAO().getViewNotesCountWithFilter(ub.getId(),currentStudy.getId());
  request.setAttribute("String_Node_Str",assignedDiscrepancies == null ? 0 : assignedDiscrepancies);
  int parentStudyId=currentStudy.getParentStudyId() > 0 ? currentStudy.getParentStudyId() : currentStudy.getId();
  StudyParameterValueDAO spvdao=new StudyParameterValueDAO(sm.getDataSource());
  StudyParameterValueBean parentSPV=spvdao.findByHandleAndStudy(parentStudyId,"String_Node_Str");
  currentStudy.getStudyParameterConfig().setSubjectIdGeneration(parentSPV.getValue());
  String idSetting=parentSPV.getValue();
  if (idSetting.equals("String_Node_Str") || idSetting.equals("String_Node_Str")) {
    request.setAttribute("String_Node_Str",resword.getString("String_Node_Str"));
    fp.addPresetValue("String_Node_Str",resword.getString("String_Node_Str"));
  }
  setPresetValues(fp.getPresetValues());
  if (currentRole.isInvestigator() || currentRole.isResearchAssistant() || currentRole.isResearchAssistant2()) {
    setupListStudySubjectTable();
  }
  if (currentRole.isMonitor()) {
    setupSubjectSDVTable();
  }
 else   if (currentRole.isCoordinator() || currentRole.isDirector()) {
    if (currentStudy.getStatus().isPending()) {
      response.sendRedirect(request.getContextPath() + Page.MANAGE_STUDY_MODULE.getFileName());
      return;
    }
    setupStudySiteStatisticsTable();
    setupSubjectEventStatusStatisticsTable();
    setupStudySubjectStatusStatisticsTable();
    if (currentStudy.getParentStudyId() == 0) {
      setupStudyStatisticsTable();
    }
  }
  forwardPage(Page.MENU);
}

Fixed version (ground truth):
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  ub.incNumVisitsToMainMenu();
  session.setAttribute(USER_BEAN_NAME,ub);
  request.setAttribute("String_Node_Str",true);
  request.setAttribute("String_Node_Str",false);
  if (ub == null || ub.getId() == 0) {
    forwardPage(Page.MENU,false);
    return;
  }
  UserAccountDAO udao=new UserAccountDAO(sm.getDataSource());
  UserAccountBean ub1=(UserAccountBean)udao.findByPK(ub.getId());
  processSpecificStudyEnvUuid(request,ub1);
  String externalReturnUrl=processExternalReturnUrl(request);
  ub1.setLastVisitDate(new Date(System.currentTimeMillis()));
  ub1.setOwner(ub1);
  ub1.setUpdater(ub1);
  udao.update(ub1);
  if (currentStudy != null) {
    request.setAttribute("String_Node_Str",currentStudy.getId());
    request.setAttribute("String_Node_Str",super.getEventDefinitionsByCurrentStudy());
    request.setAttribute("String_Node_Str",super.getStudyGroupClassesByCurrentStudy());
  }
  logger.info("String_Node_Str" + ub.isLdapUser());
  if (currentStudy == null) {
    forwardPage(Page.MENU);
    return;
  }
  if (ub.getNumVisitsToMainMenu() <= 1) {
    if (ub.getLastVisitDate() != null) {
      addPageMessage(respage.getString("String_Node_Str") + "String_Node_Str" + ub.getFirstName()+ "String_Node_Str"+ ub.getLastName()+ "String_Node_Str"+ respage.getString("String_Node_Str")+ "String_Node_Str"+ local_df.format(ub.getLastVisitDate())+ "String_Node_Str");
    }
 else {
      addPageMessage(respage.getString("String_Node_Str") + "String_Node_Str" + ub.getFirstName()+ "String_Node_Str"+ ub.getLastName()+ "String_Node_Str");
    }
    if (currentStudy.getStatus().isLocked()) {
      addPageMessage(respage.getString("String_Node_Str"));
    }
 else     if (currentStudy.getStatus().isFrozen()) {
      addPageMessage(respage.getString("String_Node_Str"));
    }
  }
  Integer assignedDiscrepancies=getDiscrepancyNoteDAO().getViewNotesCountWithFilter(ub.getId(),currentStudy.getId());
  request.setAttribute("String_Node_Str",assignedDiscrepancies == null ? 0 : assignedDiscrepancies);
  int parentStudyId=currentStudy.getParentStudyId() > 0 ? currentStudy.getParentStudyId() : currentStudy.getId();
  StudyParameterValueDAO spvdao=new StudyParameterValueDAO(sm.getDataSource());
  StudyParameterValueBean parentSPV=spvdao.findByHandleAndStudy(parentStudyId,"String_Node_Str");
  currentStudy.getStudyParameterConfig().setSubjectIdGeneration(parentSPV.getValue());
  String idSetting=parentSPV.getValue();
  if (idSetting.equals("String_Node_Str") || idSetting.equals("String_Node_Str")) {
    request.setAttribute("String_Node_Str",resword.getString("String_Node_Str"));
    fp.addPresetValue("String_Node_Str",resword.getString("String_Node_Str"));
  }
  setPresetValues(fp.getPresetValues());
  if (currentRole.isInvestigator() || currentRole.isResearchAssistant() || currentRole.isResearchAssistant2()) {
    setupListStudySubjectTable();
  }
  if (currentRole.isMonitor()) {
    setupSubjectSDVTable();
  }
 else   if (currentRole.isCoordinator() || currentRole.isDirector()) {
    if (currentStudy.getStatus().isPending()) {
      response.sendRedirect(request.getContextPath() + Page.MANAGE_STUDY_MODULE.getFileName());
      return;
    }
    setupStudySiteStatisticsTable();
    setupSubjectEventStatusStatisticsTable();
    setupStudySubjectStatusStatisticsTable();
    if (currentStudy.getParentStudyId() == 0) {
      setupStudyStatisticsTable();
    }
  }
  if (StringUtils.isNotEmpty(externalReturnUrl))   response.sendRedirect(externalReturnUrl);
 else   forwardPage(Page.MENU);
}