Program: 85428
Project: 85428
Buggy source:
public void save(IRequestCycle cycle) throws IOException {
  log.debug("String_Node_Str");
  IValidationDelegate delegate=getDelegate();
  if (!StringUtils.equals(getUser().getPassword(),getUser().getConfirmPassword())) {
    addError(delegate,"String_Node_Str",getText("String_Node_Str",new Object[]{getText("String_Node_Str"),getText("String_Node_Str")}),ValidationConstraint.CONSISTENCY);
  }
  if (delegate.getHasErrors()) {
    return;
  }
  User user=getUser();
  Boolean encrypt=(Boolean)getConfiguration().get(Constants.ENCRYPT_PASSWORD);
  if (encrypt != null && encrypt) {
    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.setEnabled(true);
  user.addRole(getRoleManager().getRole(Constants.USER_ROLE));
  try {
    getUserManager().saveUser(user);
  }
 catch (  UserExistsException e) {
    log.warn(e.getMessage());
    addError(delegate,"String_Node_Str",getMessages().format("String_Node_Str",user.getUsername(),user.getEmail()),ValidationConstraint.CONSISTENCY);
    user.setPassword(user.getConfirmPassword());
    return;
  }
  getSession().setAttribute(Constants.REGISTERED,Boolean.TRUE);
  Authentication auth=new UsernamePasswordAuthenticationToken(user.getUsername(),user.getConfirmPassword());
  try {
    ApplicationContext ctx=WebApplicationContextUtils.getWebApplicationContext(getSession().getServletContext());
    if (ctx != null) {
      ProviderManager authenticationManager=(ProviderManager)ctx.getBean("String_Node_Str");
      SecurityContextHolder.getContext().setAuthentication(authenticationManager.doAuthentication(auth));
    }
  }
 catch (  NoSuchBeanDefinitionException n) {
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + user.getUsername() + "String_Node_Str");
  }
  SimpleMailMessage message=getMailMessage();
  message.setTo(user.getFullName() + "String_Node_Str" + user.getEmail()+ "String_Node_Str");
  StringBuffer msg=new StringBuffer();
  msg.append(getText("String_Node_Str"));
  msg.append("String_Node_Str" + getText("String_Node_Str"));
  msg.append("String_Node_Str" + user.getUsername() + "String_Node_Str");
  msg.append(getText("String_Node_Str") + "String_Node_Str");
  msg.append(user.getPassword());
  msg.append("String_Node_Str" + RequestUtil.getAppURL(getRequest()));
  message.setText(msg.toString());
  message.setSubject(getText("String_Node_Str"));
  getMailEngine().send(message);
  getSession().setAttribute("String_Node_Str",getText("String_Node_Str"));
  getResponse().sendRedirect(getRequest().getContextPath());
}

Fixed version (ground truth):
public void save(IRequestCycle cycle) throws IOException {
  log.debug("String_Node_Str");
  IValidationDelegate delegate=getDelegate();
  if (!StringUtils.equals(getUser().getPassword(),getUser().getConfirmPassword())) {
    addError("String_Node_Str",getText("String_Node_Str",new Object[]{getText("String_Node_Str"),getText("String_Node_Str")}),ValidationConstraint.CONSISTENCY);
  }
  if (delegate.getHasErrors()) {
    return;
  }
  User user=getUser();
  Boolean encrypt=(Boolean)getConfiguration().get(Constants.ENCRYPT_PASSWORD);
  if (encrypt != null && encrypt) {
    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.setEnabled(true);
  user.addRole(getRoleManager().getRole(Constants.USER_ROLE));
  try {
    getUserManager().saveUser(user);
  }
 catch (  UserExistsException e) {
    log.warn(e.getMessage());
    addError("String_Node_Str",getMessages().format("String_Node_Str",user.getUsername(),user.getEmail()),ValidationConstraint.CONSISTENCY);
    user.setPassword(user.getConfirmPassword());
    return;
  }
  getSession().setAttribute(Constants.REGISTERED,Boolean.TRUE);
  Authentication auth=new UsernamePasswordAuthenticationToken(user.getUsername(),user.getConfirmPassword());
  try {
    ApplicationContext ctx=WebApplicationContextUtils.getWebApplicationContext(getSession().getServletContext());
    if (ctx != null) {
      ProviderManager authenticationManager=(ProviderManager)ctx.getBean("String_Node_Str");
      SecurityContextHolder.getContext().setAuthentication(authenticationManager.doAuthentication(auth));
    }
  }
 catch (  NoSuchBeanDefinitionException n) {
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + user.getUsername() + "String_Node_Str");
  }
  SimpleMailMessage message=getMailMessage();
  message.setTo(user.getFullName() + "String_Node_Str" + user.getEmail()+ "String_Node_Str");
  StringBuffer msg=new StringBuffer();
  msg.append(getText("String_Node_Str"));
  msg.append("String_Node_Str" + getText("String_Node_Str"));
  msg.append("String_Node_Str" + user.getUsername() + "String_Node_Str");
  msg.append(getText("String_Node_Str") + "String_Node_Str");
  msg.append(user.getPassword());
  msg.append("String_Node_Str" + RequestUtil.getAppURL(getRequest()));
  message.setText(msg.toString());
  message.setSubject(getText("String_Node_Str"));
  getMailEngine().send(message);
  getSession().setAttribute("String_Node_Str",getText("String_Node_Str"));
  getResponse().sendRedirect(getRequest().getContextPath());
}