Program: 85501
Project: 85501
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;
  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));
  user.addRole(Constants.USER_ROLE);
  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 loginCookie=mgr.createLoginCookie(user.getUsername());
  RequestUtil.setCookie(response,Constants.LOGIN_COOKIE,loginCookie,request.getContextPath());
  String message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getUsername()});
  saveMessage(request,message);
  request.getSession().setAttribute(Constants.REGISTERED,Boolean.TRUE);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + user.getUsername() + "String_Node_Str");
  }
  StringBuffer msg=new StringBuffer();
  msg.append(getMessageSourceAccessor().getMessage("String_Node_Str"));
  msg.append("String_Node_Str" + getMessageSourceAccessor().getMessage("String_Node_Str"));
  msg.append("String_Node_Str" + user.getUsername() + "String_Node_Str");
  msg.append(getMessageSourceAccessor().getMessage("String_Node_Str") + "String_Node_Str");
  msg.append(user.getPassword());
  msg.append("String_Node_Str" + RequestUtil.getAppURL(request) + request.getContextPath());
  String subject=getMessageSourceAccessor().getMessage("String_Node_Str");
  try {
    MailSender.sendTextMessage(Constants.DEFAULT_FROM,user.getEmail(),null,subject,msg.toString());
  }
 catch (  MessagingException me) {
    log.warn("String_Node_Str");
  }
  return new ModelAndView(new RedirectView(getSuccessView()));
}

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;
  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));
  user.addRole(Constants.USER_ROLE);
  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 loginCookie=mgr.createLoginCookie(user.getUsername());
  RequestUtil.setCookie(response,Constants.LOGIN_COOKIE,loginCookie,request.getContextPath());
  String message=getMessageSourceAccessor().getMessage("String_Node_Str",new Object[]{user.getUsername()});
  saveMessage(request,message);
  request.getSession().setAttribute(Constants.REGISTERED,Boolean.TRUE);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + user.getUsername() + "String_Node_Str");
  }
  StringBuffer msg=new StringBuffer();
  msg.append(getMessageSourceAccessor().getMessage("String_Node_Str"));
  msg.append("String_Node_Str" + getMessageSourceAccessor().getMessage("String_Node_Str"));
  msg.append("String_Node_Str" + user.getUsername() + "String_Node_Str");
  msg.append(getMessageSourceAccessor().getMessage("String_Node_Str") + "String_Node_Str");
  msg.append(user.getConfirmPassword());
  msg.append("String_Node_Str" + RequestUtil.getAppURL(request) + request.getContextPath());
  String subject=getMessageSourceAccessor().getMessage("String_Node_Str");
  try {
    MailSender.sendTextMessage(Constants.DEFAULT_FROM,user.getEmail(),null,subject,msg.toString());
  }
 catch (  MessagingException me) {
    log.warn("String_Node_Str");
  }
  return new ModelAndView(new RedirectView(getSuccessView()));
}