Program: 85439
Project: 85439
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=form.validate(mapping,request);
  if (!errors.isEmpty()) {
    saveErrors(request,errors);
    return mapping.findForward("String_Node_Str");
  }
  ActionMessages messages=new ActionMessages();
  HttpSession session=request.getSession();
  UserForm userForm=(UserForm)form;
  User user=new User();
  BeanUtils.copyProperties(user,userForm);
  Boolean encrypt=(Boolean)getConfiguration().get(Constants.ENCRYPT_PASSWORD);
  if (StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str") && (encrypt != null && encrypt.booleanValue())) {
    String algorithm=(String)getConfiguration().get(Constants.ENC_ALGORITHM);
    if (algorithm == null) {
      log.debug("String_Node_Str");
      algorithm="String_Node_Str";
    }
    user.setPassword(StringUtil.encodePassword(user.getPassword(),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);
    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");
    }
  }
}

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=form.validate(mapping,request);
  if (!errors.isEmpty()) {
    saveErrors(request,errors);
    return mapping.findForward("String_Node_Str");
  }
  ActionMessages messages=new ActionMessages();
  HttpSession session=request.getSession();
  UserForm userForm=(UserForm)form;
  User user=new User();
  BeanUtils.copyProperties(user,userForm);
  Boolean encrypt=(Boolean)getConfiguration().get(Constants.ENCRYPT_PASSWORD);
  if (StringUtils.equals(request.getParameter("String_Node_Str"),"String_Node_Str") && (encrypt != null && encrypt.booleanValue())) {
    String algorithm=(String)getConfiguration().get(Constants.ENC_ALGORITHM);
    if (algorithm == null) {
      log.debug("String_Node_Str");
      algorithm="String_Node_Str";
    }
    user.setPassword(StringUtil.encodePassword(user.getPassword(),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);
    BeanUtils.copyProperties(userForm,convert(user));
    userForm.setConfirmPassword(userForm.getPassword());
    updateFormBean(mapping,request,userForm);
    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);
    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");
    }
  }
}