Program: 114999
Project: 114999
Buggy source:
private void handle(HttpServletRequest req,HttpServletResponse res) throws Exception {
  try {
    String error=req.getParameter("String_Node_Str");
    if (error != null && error.equals("String_Node_Str")) {
      res.sendRedirect(controller.buildAuthorizeUrl(req,false));
    }
 else {
      Tokens tokens=controller.handle(req);
      DecodedJWT decodedJWT=JWT.decode(tokens.getAccessToken());
      TokenAuthentication tokenAuth=new TokenAuthentication(decodedJWT);
      SecurityContextHolder.getContext().setAuthentication(tokenAuth);
      CoreResources.setRequestSchema(req,"String_Node_Str");
      req.getSession().setAttribute("String_Node_Str",tokens.getAccessToken());
      Auth0User user=new Auth0User(decodedJWT);
      UserAccountHelper userAccountHelper=null;
      try {
        userAccountHelper=callbackService.isCallbackSuccessful(req,user);
      }
 catch (      Exception e) {
        logger.error(e.getMessage());
        throw e;
      }
      UserAccountBean ub=userAccountHelper.getUb();
      if (ub != null) {
        if (userAccountHelper.isUpdated())         ub=callbackService.getUpdatedUser(ub);
        req.getSession().setAttribute(USER_BEAN_NAME,ub);
      }
 else {
        unauthorized(res,"String_Node_Str");
        return;
      }
      String returnTo=controller.getReturnTo(req);
      if (returnTo == null)       returnTo=this.redirectOnSuccess;
      res.sendRedirect(returnTo);
    }
  }
 catch (  InvalidRequestException e) {
    e.printStackTrace();
    SecurityContextHolder.clearContext();
    res.sendRedirect(redirectOnFail);
  }
catch (  IdentityVerificationException e) {
    e.printStackTrace();
    SecurityContextHolder.clearContext();
    res.sendRedirect(redirectOnFail);
  }
}

Fixed version (ground truth):
private void handle(HttpServletRequest req,HttpServletResponse res) throws Exception {
  try {
    String error=req.getParameter("String_Node_Str");
    if (error != null && error.equals("String_Node_Str")) {
      res.sendRedirect(controller.buildAuthorizeUrl(req,false));
    }
 else {
      Tokens tokens=controller.handle(req);
      DecodedJWT decodedJWT=JWT.decode(tokens.getAccessToken());
      TokenAuthentication tokenAuth=new TokenAuthentication(decodedJWT);
      SecurityContextHolder.getContext().setAuthentication(tokenAuth);
      CoreResources.setRequestSchema(req,"String_Node_Str");
      req.getSession().setAttribute("String_Node_Str",tokens.getAccessToken());
      Auth0User user=new Auth0User(decodedJWT);
      UserAccountHelper userAccountHelper=null;
      try {
        userAccountHelper=callbackService.isCallbackSuccessful(req,user);
      }
 catch (      Exception e) {
        logger.error(e.getMessage());
        throw e;
      }
      UserAccountBean ub=userAccountHelper.getUb();
      if (ub != null) {
        if (userAccountHelper.isUpdated())         ub=callbackService.getUpdatedUser(ub);
        req.getSession().setAttribute(USER_BEAN_NAME,ub);
      }
 else {
        unauthorized(res,"String_Node_Str");
        return;
      }
      String returnTo=controller.getReturnTo(req);
      if (returnTo == null)       returnTo=this.redirectOnSuccess;
      res.sendRedirect(returnTo);
    }
  }
 catch (  InvalidRequestException e) {
    e.printStackTrace();
    SecurityContextHolder.clearContext();
    res.sendRedirect(req.getContextPath());
  }
catch (  IdentityVerificationException e) {
    e.printStackTrace();
    SecurityContextHolder.clearContext();
    res.sendRedirect(redirectOnFail);
  }
}