Program: 85473
Project: 85473
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());
    saveMessage(request,getText("String_Node_Str",user.getFullName()));
    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));
    }
    String[] userRoles=request.getParameterValues("String_Node_Str");
    if (userRoles != null) {
      user.getRoles().clear();
      for (int i=0; i < userRoles.length; i++) {
        String roleName=userRoles[i];
        user.addRole(roleManager.getRole(roleName));
      }
    }
    try {
      mgr.saveUser(user);
    }
 catch (    UserExistsException e) {
      log.warn(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);
    }
    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());
      }
      saveMessage(request,getText("String_Node_Str",user.getFullName()));
      return new ModelAndView(new RedirectView("String_Node_Str"));
    }
 else {
      if (StringUtils.isBlank(request.getParameter("String_Node_Str"))) {
        saveMessage(request,getText("String_Node_Str",user.getFullName()));
        message.setSubject(getText("String_Node_Str"));
        sendUserMessage(user,getText("String_Node_Str",user.getFullName()),RequestUtil.getAppURL(request));
        return showNewForm(request,response);
      }
 else {
        saveMessage(request,getText("String_Node_Str",user.getFullName()));
      }
    }
  }
  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;
  Locale locale=request.getLocale();
  if (request.getParameter("String_Node_Str") != null) {
    mgr.removeUser(user.getUsername());
    saveMessage(request,getText("String_Node_Str",user.getFullName(),locale));
    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));
    }
    String[] userRoles=request.getParameterValues("String_Node_Str");
    if (userRoles != null) {
      user.getRoles().clear();
      for (int i=0; i < userRoles.length; i++) {
        String roleName=userRoles[i];
        user.addRole(roleManager.getRole(roleName));
      }
    }
    try {
      mgr.saveUser(user);
    }
 catch (    UserExistsException e) {
      log.warn(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);
    }
    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());
      }
      saveMessage(request,getText("String_Node_Str",user.getFullName(),locale));
      return new ModelAndView(new RedirectView("String_Node_Str"));
    }
 else {
      if (StringUtils.isBlank(request.getParameter("String_Node_Str"))) {
        saveMessage(request,getText("String_Node_Str",user.getFullName(),locale));
        message.setSubject(getText("String_Node_Str",locale));
        sendUserMessage(user,getText("String_Node_Str",user.getFullName(),locale),RequestUtil.getAppURL(request));
        return showNewForm(request,response);
      }
 else {
        saveMessage(request,getText("String_Node_Str",user.getFullName(),locale));
      }
    }
  }
  return showForm(request,response,errors);
}