From 23354b01558f4ac2c22579901a6480a628c52c12 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 11 Nov 2025 19:41:44 +0100 Subject: [PATCH 1/2] Fix doTask method visibility (referring to private Task type) See gh-35794 --- .../util/ConcurrentReferenceHashMap.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java b/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java index 842128cff4d..7ebcb78aa80 100644 --- a/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java +++ b/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java @@ -628,7 +628,7 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen * @return the result of the operation */ @Nullable - public T doTask(final int hash, @Nullable final Object key, final Task task) { + private T doTask(final int hash, @Nullable final Object key, final Task task) { boolean resize = task.hasOption(TaskOption.RESIZE); if (task.hasOption(TaskOption.RESTRUCTURE_BEFORE)) { restructureIfNecessary(resize); @@ -693,7 +693,6 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen } private void restructure(boolean allowResize, @Nullable Reference ref) { - boolean needsResize; lock(); try { int expectedCount = this.count.get(); @@ -709,7 +708,7 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen // Estimate new count, taking into account count inside lock and items that // will be purged. - needsResize = (expectedCount > 0 && expectedCount >= this.resizeThreshold); + boolean needsResize = (expectedCount > 0 && expectedCount >= this.resizeThreshold); boolean resizing = false; int restructureSize = this.references.length; if (allowResize && needsResize && restructureSize < MAXIMUM_SEGMENT_SIZE) { @@ -750,8 +749,8 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen while (ref != null) { if (!toPurge.contains(ref)) { Entry entry = ref.get(); - // Also filter out null references that are now null - // they should be polled from the queue in a later restructure call. + // Also filter out null references that are now null: + // They should be polled from the queue in a later restructure call. if (entry != null) { purgedRef = this.referenceManager.createReference( entry, ref.getHash(), purgedRef); @@ -763,7 +762,7 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen this.references[i] = purgedRef; } } - this.count.set(Math.max(newCount, 0)); + this.count.set(newCount); } finally { unlock(); From 40544e096f9ec1b5e73df7f826557dae5e5c4663 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 11 Nov 2025 19:42:02 +0100 Subject: [PATCH 2/2] Fix typo in ProxyMethodInvocation javadoc --- .../java/org/springframework/aop/ProxyMethodInvocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java b/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java index 96f414373d3..d7187f36c69 100644 --- a/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java +++ b/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java @@ -62,7 +62,7 @@ public interface ProxyMethodInvocation extends MethodInvocation { MethodInvocation invocableClone(Object... arguments); /** - * Set the arguments to be used on subsequent invocations in the any advice + * Set the arguments to be used on subsequent invocations in any advice * in this chain. * @param arguments the argument array */