From 1898dffcdba4cd9d905abf70eef0a574ed2f64ce Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Tue, 29 Oct 2024 13:16:27 -0400 Subject: [PATCH] Reuse Function.identity() --- .../java/org/apache/hc/client5/http/cache/HttpCacheEntry.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java index e69eb185f..5f7f10ee1 100644 --- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java +++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/HttpCacheEntry.java @@ -37,6 +37,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; import java.util.stream.Collectors; import org.apache.hc.client5.http.utils.DateUtils; @@ -449,7 +450,7 @@ public Set getVariants() { @Deprecated public Map getVariantMap() { return variants != null ? variants.stream() - .collect(Collectors.toMap(e -> e, e -> e + requestURI)) : Collections.emptyMap(); + .collect(Collectors.toMap(Function.identity(), e -> e + requestURI)) : Collections.emptyMap(); } /**