Program: 85502
Project: 85502
Buggy source:
public ModelAndView onSubmit(HttpServletRequest request,HttpServletResponse response,Object command,BindException errors) throws Exception {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  User user=(User)command;
  if (request.getParameter("String_Node_Str") != null) {
    mgr.removeUser(user.getUsername());
    String message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getUsername()});
    saveMessage(request,message);
    return new ModelAndView(new RedirectView("String_Node_Str"));
  }
 else {
    if ("String_Node_Str".equals(request.getParameter("String_Node_Str"))) {
      String algorithm=(String)getConfiguration().get(Constants.ENC_ALGORITHM);
      if (algorithm == null) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str");
        }
        algorithm="String_Node_Str";
      }
      user.setPassword(StringUtil.encodePassword(user.getPassword(),algorithm));
    }
    try {
      mgr.saveUser(user);
    }
 catch (    Exception e) {
      if ((e.getMessage() != null) && (e.getMessage().indexOf("String_Node_Str") != -1)) {
        log.warn("String_Node_Str" + e.getMessage());
        errors.rejectValue("String_Node_Str","String_Node_Str",new Object[]{user.getUsername(),user.getEmail()},"String_Node_Str");
        user.setPassword(user.getConfirmPassword());
        return showForm(request,response,errors);
      }
    }
    String message=null;
    if (!StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str")) {
      HttpSession session=request.getSession();
      session.setAttribute(Constants.USER_KEY,user);
      if ((RequestUtil.getCookie(request,Constants.LOGIN_COOKIE) != null) && (session.getAttribute("String_Node_Str") == null)) {
        mgr.removeLoginCookies(user.getUsername());
        String autoLogin=mgr.createLoginCookie(user.getUsername());
        RequestUtil.setCookie(response,Constants.LOGIN_COOKIE,autoLogin,request.getContextPath());
      }
      message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getFullName()});
      saveMessage(request,message);
      return new ModelAndView(new RedirectView("String_Node_Str"));
    }
 else {
      String msg=null;
      if (StringUtils.isEmpty(request.getParameter("String_Node_Str"))) {
        message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getFullName()});
        saveMessage(request,message);
        sendNewUserEmail(user);
        return showNewForm(request,response);
      }
 else {
        message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getFullName()});
        saveMessage(request,message);
      }
    }
  }
  return showForm(request,response,errors);
}

Fixed version (ground truth):
public ModelAndView onSubmit(HttpServletRequest request,HttpServletResponse response,Object command,BindException errors) throws Exception {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  User user=(User)command;
  if (request.getParameter("String_Node_Str") != null) {
    mgr.removeUser(user.getUsername());
    String message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getUsername()});
    saveMessage(request,message);
    return new ModelAndView(new RedirectView("String_Node_Str"));
  }
 else {
    if ("String_Node_Str".equals(request.getParameter("String_Node_Str"))) {
      String algorithm=(String)getConfiguration().get(Constants.ENC_ALGORITHM);
      if (algorithm == null) {
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str");
        }
        algorithm="String_Node_Str";
      }
      user.setPassword(StringUtil.encodePassword(user.getPassword(),algorithm));
    }
    try {
      mgr.saveUser(user);
    }
 catch (    Exception e) {
      if ((e.getMessage() != null) && (e.getMessage().indexOf("String_Node_Str") != -1)) {
        log.warn("String_Node_Str" + e.getMessage());
        errors.rejectValue("String_Node_Str","String_Node_Str",new Object[]{user.getUsername(),user.getEmail()},"String_Node_Str");
        user.setPassword(user.getConfirmPassword());
        return showForm(request,response,errors);
      }
    }
    String message=null;
    if (!StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str")) {
      HttpSession session=request.getSession();
      session.setAttribute(Constants.USER_KEY,user);
      if ((RequestUtil.getCookie(request,Constants.LOGIN_COOKIE) != null) && (session.getAttribute("String_Node_Str") == null)) {
        mgr.removeLoginCookies(user.getUsername());
        String autoLogin=mgr.createLoginCookie(user.getUsername());
        RequestUtil.setCookie(response,Constants.LOGIN_COOKIE,autoLogin,request.getContextPath());
      }
      message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getFullName()});
      saveMessage(request,message);
      return new ModelAndView(new RedirectView("String_Node_Str"));
    }
 else {
      String msg=null;
      if (StringUtils.isEmpty(request.getParameter("String_Node_Str"))) {
        message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getFullName()});
        saveMessage(request,message);
        sendNewUserEmail(user,request);
        return showNewForm(request,response);
      }
 else {
        message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getFullName()});
        saveMessage(request,message);
      }
    }
  }
  return showForm(request,response,errors);
}