Description
The following code throws an Exception:
CacheConfig cacheConfig = CacheConfig.custom().setAsynchronousWorkersMax(0).build();
CachingHttpClientBuilder.create().setCacheConfig(cacheConfig).build();
java.lang.IllegalArgumentException
at java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:826)
at java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:717)
at org.apache.http.impl.client.cache.AsynchronousValidator.<init>(AsynchronousValidator.java:74)
at org.apache.http.impl.client.cache.CachingHttpClientBuilder.createAsynchronousRevalidator(CachingHttpClientBuilder.java:106)
at org.apache.http.impl.client.cache.CachingHttpClientBuilder.decorateMainExec(CachingHttpClientBuilder.java:100)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:528)
According to the javadoc of method org.apache.http.impl.client.cache.CacheConfig.Builder.setAsynchronousWorkersMax(int) "a value of 0 disables background revalidations"