调用EntityTag.matchesRange

时间:2019-04-21 14:22:29

标签: java akka akka-http

尝试为Web服务器设置ETag时,将EntityTag(由我生成)与IfNoneMatch请求标头进行比较时,出现了StackOverflowError。我是在误解这里的东西还是错误?

import akka.http.javadsl.model.headers.*;
public class EntityTagTest {
  public static void main(String[] args){
    System.out.println(
      "VERSIONS: akka:" + akka.Version.current() +
      "; akka-http: " + akka.http.Version.current());
    // Output: VERSIONS: akka 2.5.22; akka-http: 10.1.8
    boolean isWeak = false;
    EntityTag tag = EntityTag.create("foo", isWeak);
    EntityTagRange range = EntityTagRange.create(tag);
    boolean matches = EntityTag.matchesRange(tag, range, isWeak);
    /*
    Exception in thread "main" java.lang.StackOverflowError
    at akka.http.javadsl.model.headers.EntityTag.matches(EntityTag.java:18)
    at akka.http.javadsl.model.headers.EntityTag.matches(EntityTag.java:18)
    at akka.http.javadsl.model.headers.EntityTag.matches(EntityTag.java:18)
    ...
    */
    System.out.println(matches);
  }
}

0 个答案:

没有答案