From fc47d25bc7fd7fc0ff3875f5be996cd5cb0783d4 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Fri, 2 Sep 2022 10:55:40 +0200 Subject: [PATCH] Polish See gh-26320 --- .../main/java/org/springframework/util/ConcurrentLruCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/util/ConcurrentLruCache.java b/spring-core/src/main/java/org/springframework/util/ConcurrentLruCache.java index c4d02819bf..f37fc5cc8f 100644 --- a/spring-core/src/main/java/org/springframework/util/ConcurrentLruCache.java +++ b/spring-core/src/main/java/org/springframework/util/ConcurrentLruCache.java @@ -110,7 +110,7 @@ public final class ConcurrentLruCache { Assert.notNull(value, "value should not be null"); final CacheEntry cacheEntry = new CacheEntry<>(value, CacheEntryState.ACTIVE); final Node node = new Node<>(key, cacheEntry); - final Node prior = this.cache.put(node.key, node); + final Node prior = this.cache.putIfAbsent(node.key, node); if (prior == null) { processWrite(new AddTask(node)); }