Program: 85474
Project: 85474
Buggy source:
public ActionForward save(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  ActionMessages errors=new ActionMessages();
  ActionMessages messages=new ActionMessages();
  HttpSession session=request.getSession();
  UserForm userForm=(UserForm)form;
  String password=userForm.getPassword();
  User user=new User();
  BeanUtils.copyProperties(user,userForm);
  if (StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str")) {
    String algorithm=(String)getConfiguration().get(Constants.ENC_ALGORITHM);
    if (algorithm == null) {
      log.debug("String_Node_Str");
      algorithm="String_Node_Str";
    }
    user.setPassword(StringUtil.encodePassword(password,algorithm));
  }
  UserManager mgr=(UserManager)getBean("String_Node_Str");
  RoleManager roleMgr=(RoleManager)getBean("String_Node_Str");
  String[] userRoles=request.getParameterValues("String_Node_Str");
  for (int i=0; userRoles != null && i < userRoles.length; i++) {
    String roleName=userRoles[i];
    user.addRole(roleMgr.getRole(roleName));
  }
  try {
    mgr.saveUser(user);
  }
 catch (  UserExistsException e) {
    log.warn(e.getMessage());
    errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str",userForm.getUsername(),userForm.getEmail()));
    saveErrors(request,errors);
    return mapping.findForward("String_Node_Str");
  }
  BeanUtils.copyProperties(userForm,convert(user));
  userForm.setConfirmPassword(userForm.getPassword());
  updateFormBean(mapping,request,userForm);
  if (!StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str")) {
    session.setAttribute(Constants.USER_KEY,user);
    if ((RequestUtil.getCookie(request,Constants.LOGIN_COOKIE) != null) && (session.getAttribute("String_Node_Str") == null)) {
      mgr.removeLoginCookies(userForm.getUsername());
      String autoLogin=mgr.createLoginCookie(userForm.getUsername());
      RequestUtil.setCookie(response,Constants.LOGIN_COOKIE,autoLogin,request.getContextPath());
    }
    messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str"));
    saveMessages(request.getSession(),messages);
    return mapping.findForward("String_Node_Str");
  }
 else {
    if ("String_Node_Str".equals(request.getParameter("String_Node_Str"))) {
      messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str",userForm.getFullName()));
      session.setAttribute(Globals.MESSAGE_KEY,messages);
      sendNewUserEmail(request,userForm);
      return mapping.findForward("String_Node_Str");
    }
 else {
      messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str",userForm.getFullName()));
      saveMessages(request,messages);
      return mapping.findForward("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public ActionForward save(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
  ActionMessages errors=new ActionMessages();
  ActionMessages messages=new ActionMessages();
  HttpSession session=request.getSession();
  UserForm userForm=(UserForm)form;
  String password=userForm.getPassword();
  User user=new User();
  BeanUtils.copyProperties(user,userForm);
  if (StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str")) {
    String algorithm=(String)getConfiguration().get(Constants.ENC_ALGORITHM);
    if (algorithm == null) {
      log.debug("String_Node_Str");
      algorithm="String_Node_Str";
    }
    user.setPassword(StringUtil.encodePassword(password,algorithm));
  }
  UserManager mgr=(UserManager)getBean("String_Node_Str");
  RoleManager roleMgr=(RoleManager)getBean("String_Node_Str");
  String[] userRoles=request.getParameterValues("String_Node_Str");
  for (int i=0; userRoles != null && i < userRoles.length; i++) {
    String roleName=userRoles[i];
    user.addRole(roleMgr.getRole(roleName));
  }
  try {
    mgr.saveUser(user);
  }
 catch (  UserExistsException e) {
    log.warn(e.getMessage());
    errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str",userForm.getUsername(),userForm.getEmail()));
    saveErrors(request,errors);
    return mapping.findForward("String_Node_Str");
  }
  BeanUtils.copyProperties(userForm,convert(user));
  userForm.setConfirmPassword(userForm.getPassword());
  updateFormBean(mapping,request,userForm);
  if (!StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str")) {
    session.setAttribute(Constants.USER_KEY,user);
    if ((RequestUtil.getCookie(request,Constants.LOGIN_COOKIE) != null) && (session.getAttribute("String_Node_Str") == null)) {
      mgr.removeLoginCookies(userForm.getUsername());
      String autoLogin=mgr.createLoginCookie(userForm.getUsername());
      RequestUtil.setCookie(response,Constants.LOGIN_COOKIE,autoLogin,request.getContextPath());
    }
    messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str"));
    saveMessages(request.getSession(),messages);
    return mapping.findForward("String_Node_Str");
  }
 else {
    if ("String_Node_Str".equals(request.getParameter("String_Node_Str"))) {
      messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str",user.getFullName()));
      saveMessages(request.getSession(),messages);
      sendNewUserEmail(request,userForm);
      return mapping.findForward("String_Node_Str");
    }
 else {
      messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("String_Node_Str",user.getFullName()));
      saveMessages(request,messages);
      return mapping.findForward("String_Node_Str");
    }
  }
}