Program: 16768
Project: 16768
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void doFilter(ServletRequest rawRequest,ServletResponse rawResponse,FilterChain chain) throws IOException, ServletException {
  if (rawRequest instanceof HttpServletRequest && rawResponse instanceof HttpServletResponse) {
    HttpServletRequest request=(HttpServletRequest)rawRequest;
    HttpServletResponse response=(HttpServletResponse)rawResponse;
    Token token=null;
    logger.trace("String_Node_Str",request.getRequestURL());
    String tokenValue=request.getHeader(HttpHeaders.AUTHORIZATION);
    String otherValue=null;
    String method=request.getMethod();
    if (request.getHeader(HttpHeaders.CONTENT_TYPE) == MediaType.APPLICATION_FORM_URLENCODED && (method == HttpMethod.POST || method == HttpMethod.DELETE || method == HttpMethod.PUT)) {
      otherValue=request.getParameter(ACCESSTOKEN_PARAMETER);
    }
 else {
      otherValue=request.getParameter(ACCESSTOKEN_PARAMETER);
    }
    if (tokenValue == null && otherValue == null) {
      logger.trace("String_Node_Str");
      setError(response,Error.UNAUTHORIZED_REQUEST.value(),null,Error.UNAUTHORIZED_REQUEST.status());
    }
 else     if (tokenValue != null && otherValue != null) {
      String error="String_Node_Str";
      logger.trace("String_Node_Str",error);
      setError(response,Error.INVALID_REQUEST.value(),error,Error.INVALID_REQUEST.status());
    }
 else {
      tokenValue=tokenValue == null ? otherValue : tokenValue;
      if (tokenValue.matches("String_Node_Str")) {
        String accessToken=tokenValue.replace("String_Node_Str","String_Node_Str");
        accessToken=accessToken.substring(0,accessToken.length() - 1);
        logger.trace("String_Node_Str",accessToken);
        try {
          token=service.validateToken(accessToken);
        }
 catch (        Exception exc) {
          logger.warn("String_Node_Str",request.getRequestURL(),exc.getMessage());
          logger.warn("String_Node_Str",exc);
          setError(response,null,null,Status.INTERNAL_SERVER_ERROR);
        }
        if (token == null) {
          logger.trace("String_Node_Str",accessToken);
          setError(response,Error.INVALID_TOKEN.value(),"String_Node_Str",Error.INVALID_TOKEN.status());
        }
 else {
          Date now=new Date();
          Long expired=(now.getTime() - token.createdOn.getTime()) / 1000;
          if (expired > token.lifeTime) {
            logger.trace("String_Node_Str",accessToken);
            StringBuilder sb=new StringBuilder("String_Node_Str").append(expired - token.lifeTime).append("String_Node_Str");
            setError(response,Error.EXPIRED_TOKEN.value(),sb.toString(),Error.EXPIRED_TOKEN.status());
            token=null;
          }
        }
      }
 else {
        StringBuilder sb=new StringBuilder("String_Node_Str").append(HttpHeaders.WWW_AUTHENTICATE).append("String_Node_Str");
        logger.trace("String_Node_Str",sb.toString());
        setError(response,Error.INVALID_REQUEST.value(),sb.toString(),Error.INVALID_REQUEST.status());
      }
    }
    if (token != null) {
      chain.doFilter(new SecuredHttpRequest(token.userId,token.permissions,request),rawResponse);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void doFilter(ServletRequest rawRequest,ServletResponse rawResponse,FilterChain chain) throws IOException, ServletException {
  if (rawRequest instanceof HttpServletRequest && rawResponse instanceof HttpServletResponse) {
    HttpServletRequest request=(HttpServletRequest)rawRequest;
    HttpServletResponse response=(HttpServletResponse)rawResponse;
    Token token=null;
    logger.trace("String_Node_Str",request.getRequestURL());
    String tokenValue=request.getHeader(HttpHeaders.AUTHORIZATION);
    String otherValue=null;
    String method=request.getMethod();
    if (request.getHeader(HttpHeaders.CONTENT_TYPE) == MediaType.APPLICATION_FORM_URLENCODED && (method == HttpMethod.POST || method == HttpMethod.DELETE || method == HttpMethod.PUT)) {
      otherValue=request.getParameter(ACCESSTOKEN_PARAMETER);
    }
 else {
      otherValue=request.getParameter(ACCESSTOKEN_PARAMETER);
    }
    if (tokenValue == null && otherValue == null) {
      logger.trace("String_Node_Str");
      setError(response,Error.UNAUTHORIZED_REQUEST.value(),null,Error.UNAUTHORIZED_REQUEST.status());
    }
 else     if (tokenValue != null && otherValue != null) {
      String error="String_Node_Str";
      logger.trace("String_Node_Str",error);
      setError(response,Error.INVALID_REQUEST.value(),error,Error.INVALID_REQUEST.status());
    }
 else {
      tokenValue=tokenValue == null ? otherValue : tokenValue;
      if (tokenValue.matches("String_Node_Str")) {
        String accessToken=tokenValue.replace("String_Node_Str","String_Node_Str");
        accessToken=accessToken.substring(0,accessToken.length() - 1);
        logger.trace("String_Node_Str",accessToken);
        try {
          token=service.validateToken(accessToken);
        }
 catch (        Exception exc) {
          logger.warn("String_Node_Str",request.getRequestURL(),exc.getMessage());
          logger.warn("String_Node_Str",exc);
          setError(response,null,null,Status.INTERNAL_SERVER_ERROR);
        }
        if (token == null) {
          logger.trace("String_Node_Str",accessToken);
          setError(response,Error.INVALID_TOKEN.value(),"String_Node_Str",Error.INVALID_TOKEN.status());
        }
 else {
          Date now=new Date();
          Long expired=(now.getTime() - token.createdOn.getTime()) / 1000;
          if (expired > token.lifeTime) {
            logger.trace("String_Node_Str",accessToken);
            StringBuilder sb=new StringBuilder("String_Node_Str").append(expired - token.lifeTime).append("String_Node_Str");
            setError(response,Error.EXPIRED_TOKEN.value(),sb.toString(),Error.EXPIRED_TOKEN.status());
            token=null;
          }
        }
      }
 else {
        StringBuilder sb=new StringBuilder("String_Node_Str");
        logger.trace("String_Node_Str",sb.toString());
        setError(response,Error.INVALID_REQUEST.value(),sb.toString(),Error.INVALID_REQUEST.status());
      }
    }
    if (token != null) {
      chain.doFilter(new SecuredHttpRequest(token.userId,token.permissions,request),rawResponse);
    }
  }
}