Skip to content

Commit eadc5b0

Browse files
committed
Merge branch '6.2.x'
# Conflicts: # spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
2 parents 39d29c8 + 40544e0 commit eadc5b0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public interface ProxyMethodInvocation extends MethodInvocation {
6161
MethodInvocation invocableClone(@Nullable Object... arguments);
6262

6363
/**
64-
* Set the arguments to be used on subsequent invocations in the any advice
64+
* Set the arguments to be used on subsequent invocations in any advice
6565
* in this chain.
6666
* @param arguments the argument array
6767
*/

spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ public Segment(int initialSize, int resizeThreshold) {
609609
* @param task the update operation
610610
* @return the result of the operation
611611
*/
612-
public <T> @Nullable T doTask(final int hash, final @Nullable Object key, final Task<T> task) {
612+
private <T> @Nullable T doTask(final int hash, final @Nullable Object key, final Task<T> task) {
613613
boolean resize = task.hasOption(TaskOption.RESIZE);
614614
if (task.hasOption(TaskOption.RESTRUCTURE_BEFORE)) {
615615
restructureIfNecessary(resize);
@@ -674,7 +674,6 @@ void restructureIfNecessary(boolean allowResize) {
674674
}
675675

676676
private void restructure(boolean allowResize, @Nullable Reference<K, V> ref) {
677-
boolean needsResize;
678677
lock();
679678
try {
680679
int expectedCount = this.count.get();
@@ -690,7 +689,7 @@ private void restructure(boolean allowResize, @Nullable Reference<K, V> ref) {
690689

691690
// Estimate new count, taking into account count inside lock and items that
692691
// will be purged.
693-
needsResize = (expectedCount > 0 && expectedCount >= this.resizeThreshold);
692+
boolean needsResize = (expectedCount > 0 && expectedCount >= this.resizeThreshold);
694693
boolean resizing = false;
695694
int restructureSize = this.references.length;
696695
if (allowResize && needsResize && restructureSize < MAXIMUM_SEGMENT_SIZE) {
@@ -731,8 +730,8 @@ private void restructure(boolean allowResize, @Nullable Reference<K, V> ref) {
731730
while (ref != null) {
732731
if (!toPurge.contains(ref)) {
733732
Entry<K, V> entry = ref.get();
734-
// Also filter out null references that are now null
735-
// they should be polled from the queue in a later restructure call.
733+
// Also filter out null references that are now null:
734+
// They should be polled from the queue in a later restructure call.
736735
if (entry != null) {
737736
purgedRef = this.referenceManager.createReference(
738737
entry, ref.getHash(), purgedRef);
@@ -744,7 +743,7 @@ private void restructure(boolean allowResize, @Nullable Reference<K, V> ref) {
744743
this.references[i] = purgedRef;
745744
}
746745
}
747-
this.count.set(Math.max(newCount, 0));
746+
this.count.set(newCount);
748747
}
749748
finally {
750749
unlock();

0 commit comments

Comments
 (0)