Program: 9934
Project: 9934
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  resp.setContentType("String_Node_Str");
  HttpSession session=req.getSession();
  Credentials credentials=(Credentials)session.getAttribute(InitiateLoginServlet.CREDENTIALS);
  session.setAttribute("String_Node_Str",req.getAttribute("String_Node_Str"));
  if (credentials == null) {
    String token=getTokenCookie(req);
    PortalContainer pContainer=PortalContainer.getInstance();
    ServletContext context=pContainer.getPortalContext();
    if (token != null) {
      AbstractTokenService tokenService=AbstractTokenService.getInstance(CookieTokenService.class);
      credentials=tokenService.validateToken(token,false);
      if (credentials == null) {
        Cookie cookie=new Cookie(InitiateLoginServlet.COOKIE_NAME,"String_Node_Str");
        cookie.setPath(req.getContextPath());
        cookie.setMaxAge(0);
        resp.addCookie(cookie);
        context.getRequestDispatcher("String_Node_Str").include(req,resp);
        return;
      }
    }
 else {
      context.getRequestDispatcher("String_Node_Str").include(req,resp);
      return;
    }
  }
 else {
    req.getSession().removeAttribute(InitiateLoginServlet.CREDENTIALS);
  }
  String token=null;
  for (  Cookie cookie : req.getCookies()) {
    if (InitiateLoginServlet.COOKIE_NAME.equals(cookie.getName())) {
      String rememberme=req.getParameter(COOKIE_NAME);
      if (rememberme != null) {
        token=cookie.getValue();
        break;
      }
    }
  }
  if (token == null) {
    TransientTokenService tokenService=AbstractTokenService.getInstance(TransientTokenService.class);
    token=tokenService.createToken(credentials);
  }
  sendAuth(resp,credentials.getUsername(),token);
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  resp.setContentType("String_Node_Str");
  HttpSession session=req.getSession();
  Credentials credentials=(Credentials)session.getAttribute(InitiateLoginServlet.CREDENTIALS);
  if (credentials == null) {
    PortalContainer pContainer=PortalContainer.getInstance();
    ServletContext context=pContainer.getPortalContext();
    String token=getRememberMeTokenCookie(req);
    if (token != null) {
      AbstractTokenService tokenService=AbstractTokenService.getInstance(CookieTokenService.class);
      credentials=tokenService.validateToken(token,false);
      if (credentials == null) {
        log.debug("String_Node_Str" + token + "String_Node_Str"+ "String_Node_Str");
        Cookie cookie=new Cookie(InitiateLoginServlet.COOKIE_NAME,"String_Node_Str");
        cookie.setPath(req.getContextPath());
        cookie.setMaxAge(0);
        resp.addCookie(cookie);
        context.getRequestDispatcher("String_Node_Str").include(req,resp);
      }
 else {
        log.debug("String_Node_Str" + token + "String_Node_Str"+ "String_Node_Str");
        sendAuth(resp,credentials.getUsername(),token);
      }
    }
 else {
      log.debug("String_Node_Str");
      context.getRequestDispatcher("String_Node_Str").include(req,resp);
    }
  }
 else {
    TransientTokenService tokenService=AbstractTokenService.getInstance(TransientTokenService.class);
    String token=tokenService.createToken(credentials);
    req.getSession().removeAttribute(InitiateLoginServlet.CREDENTIALS);
    log.debug("String_Node_Str");
    sendAuth(resp,credentials.getUsername(),token);
  }
}