From 6bdd389356f3651ff604da6d48eb12e246bc92de Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Sun, 20 Aug 2023 12:28:51 +0200 Subject: [PATCH] Removed unused method argument --- .../apache/hc/client5/http/impl/cache/AsyncCachingExec.java | 6 +++--- .../org/apache/hc/client5/http/impl/cache/CachingExec.java | 6 +++--- .../apache/hc/client5/http/impl/cache/CachingExecBase.java | 1 - .../client5/http/impl/cache/CachingHttpClientBuilder.java | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java index 38562f30f..bf99622cc 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java @@ -606,7 +606,7 @@ private void handleCacheHit( } LOG.debug("Cache hit"); try { - final SimpleHttpResponse cacheResponse = generateCachedResponse(responseCacheControl, hit.entry, request, context); + final SimpleHttpResponse cacheResponse = generateCachedResponse(hit.entry, request, context); triggerResponse(cacheResponse, scope, asyncExecCallback); } catch (final ResourceIOException ex) { recordCacheFailure(target, request); @@ -634,7 +634,7 @@ private void handleCacheHit( && (validityPolicy.mayReturnStaleWhileRevalidating(responseCacheControl, hit.entry, now) || staleIfErrorEnabled)) { LOG.debug("Serving stale with asynchronous revalidation"); try { - final SimpleHttpResponse cacheResponse = generateCachedResponse(responseCacheControl, hit.entry, request, context); + final SimpleHttpResponse cacheResponse = generateCachedResponse(hit.entry, request, context); final String exchangeId = ExecSupport.getNextExchangeId(); context.setExchangeId(exchangeId); final AsyncExecChain.Scope fork = new AsyncExecChain.Scope( @@ -658,7 +658,7 @@ private void handleCacheHit( LOG.debug("Serving stale response due to IOException and stale-if-error enabled"); } try { - final SimpleHttpResponse cacheResponse = generateCachedResponse(responseCacheControl, hit.entry, request, context); + final SimpleHttpResponse cacheResponse = generateCachedResponse(hit.entry, request, context); triggerResponse(cacheResponse, scope, asyncExecCallback); } catch (final ResourceIOException ex2) { if (LOG.isDebugEnabled()) { diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExec.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExec.java index b79b218a2..c42b2b844 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExec.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExec.java @@ -256,7 +256,7 @@ private ClassicHttpResponse handleCacheHit( } LOG.debug("Cache hit"); try { - return convert(generateCachedResponse(responseCacheControl, hit.entry, request, context), scope); + return convert(generateCachedResponse(hit.entry, request, context), scope); } catch (final ResourceIOException ex) { recordCacheFailure(target, request); if (!mayCallBackend(requestCacheControl)) { @@ -284,7 +284,7 @@ private ClassicHttpResponse handleCacheHit( scope.originalRequest, scope.execRuntime.fork(null), HttpClientContext.create()); - final SimpleHttpResponse response = generateCachedResponse(responseCacheControl, hit.entry, request, context); + final SimpleHttpResponse response = generateCachedResponse(hit.entry, request, context); cacheRevalidator.revalidateCacheEntry( hit.getEntryKey(), () -> revalidateCacheEntry(requestCacheControl, responseCacheControl, hit, target, request, fork, chain)); @@ -296,7 +296,7 @@ private ClassicHttpResponse handleCacheHit( if (LOG.isDebugEnabled()) { LOG.debug("Serving stale response due to IOException and stale-if-error enabled"); } - return convert(generateCachedResponse(responseCacheControl, hit.entry, request, context), scope); + return convert(generateCachedResponse(hit.entry, request, context), scope); } return convert(handleRevalidationFailure(requestCacheControl, responseCacheControl, hit.entry, request, context, now), scope); } diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java index 16ac29aec..e9c781fa8 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java @@ -157,7 +157,6 @@ void recordCacheUpdate(final HttpContext context) { } SimpleHttpResponse generateCachedResponse( - final ResponseCacheControl responseCacheControl, final HttpCacheEntry entry, final HttpRequest request, final HttpContext context) throws ResourceIOException { diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java index aa9b992d4..ebbd19dd9 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingHttpClientBuilder.java @@ -95,7 +95,7 @@ public final CachingHttpClientBuilder setCacheConfig(final CacheConfig cacheConf * @deprecated Do not use. */ @Deprecated - public final CachingHttpClientBuilder setHttpCacheInvalidator(final org.apache.hc.client5.http.cache.HttpAsyncCacheInvalidator cacheInvalidator) { + public final CachingHttpClientBuilder setHttpCacheInvalidator(final org.apache.hc.client5.http.cache.HttpCacheInvalidator cacheInvalidator) { return this; }