Program: 115065
Project: 115065
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String registerParticipate(@PathVariable("String_Node_Str") String studyOid,HttpServletRequest request) throws Exception {
  studyDao=new StudyDAO(dataSource);
  StudyBean study=studyDao.findByOid(studyOid);
  StudyParameterValueDAO spvdao=new StudyParameterValueDAO(dataSource);
  StudyParameterValueBean spv=spvdao.findByHandleAndStudy(study.getId(),"String_Node_Str");
  ParticipantPortalRegistrar registrar=new ParticipantPortalRegistrar();
  Locale locale=LocaleResolver.getLocale(request);
  ResourceBundleProvider.updateLocale(locale);
  respage=ResourceBundleProvider.getPageMessagesBundle(locale);
  String status="String_Node_Str";
  String hostName=request.getParameter("String_Node_Str");
  if (hostName == null || hostName.equals("String_Node_Str")) {
    addPageMessage(request,respage.getString("String_Node_Str"));
    return "String_Node_Str";
  }
 else   if (!registrar.getHostNameAvailability(hostName).equals(ParticipantPortalRegistrar.AVAILABLE)) {
    addPageMessage(request,respage.getString("String_Node_Str"));
    return "String_Node_Str";
  }
 else {
    status=registrar.registerStudy(study.getOid(),hostName);
  }
  if (status.equals("String_Node_Str")) {
    addPageMessage(request,respage.getString("String_Node_Str"));
  }
 else {
    spv.setValue("String_Node_Str");
    if (spv.getId() > 0)     spvdao.update(spv);
 else     spvdao.create(spv);
    StudyBean currentStudy=(StudyBean)request.getSession().getAttribute("String_Node_Str");
    currentStudy.getStudyParameterConfig().setParticipantPortal("String_Node_Str");
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String registerParticipate(@PathVariable("String_Node_Str") String studyOid,HttpServletRequest request) throws Exception {
  studyDao=new StudyDAO(dataSource);
  StudyBean study=studyDao.findByOid(studyOid);
  StudyParameterValueDAO spvdao=new StudyParameterValueDAO(dataSource);
  StudyParameterValueBean spv=spvdao.findByHandleAndStudy(study.getId(),"String_Node_Str");
  ParticipantPortalRegistrar registrar=new ParticipantPortalRegistrar();
  Locale locale=LocaleResolver.getLocale(request);
  ResourceBundleProvider.updateLocale(locale);
  respage=ResourceBundleProvider.getPageMessagesBundle(locale);
  String status="String_Node_Str";
  String hostName=request.getParameter("String_Node_Str");
  if (hostName == null || hostName.equals("String_Node_Str")) {
    addPageMessage(request,respage.getString("String_Node_Str"));
    return "String_Node_Str";
  }
 else   if (!registrar.getHostNameAvailability(hostName).equals(ParticipantPortalRegistrar.AVAILABLE)) {
    addPageMessage(request,respage.getString("String_Node_Str"));
    return "String_Node_Str";
  }
 else {
    status=registrar.registerStudy(study.getOid(),hostName);
  }
  if (status.equals("String_Node_Str")) {
    addPageMessage(request,respage.getString("String_Node_Str"));
  }
 else {
    spv.setStudyId(study.getId());
    spv.setParameter("String_Node_Str");
    spv.setValue("String_Node_Str");
    if (spv.getId() > 0)     spvdao.update(spv);
 else     spvdao.create(spv);
    StudyBean currentStudy=(StudyBean)request.getSession().getAttribute("String_Node_Str");
    currentStudy.getStudyParameterConfig().setParticipantPortal("String_Node_Str");
  }
  return "String_Node_Str";
}