Fix ConcurrentReferenceHashMap max constraints

Update calculateShift to respect the maximum upper bound as well as the
minimum value.

Issue: SPR-11720
master
HejiaHo 11 years ago committed by Phillip Webb
parent 5559209233
commit 16410cad4d
  1. 2
      spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java

@ -387,7 +387,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
protected static int calculateShift(int minimumValue, int maximumValue) {
int shift = 0;
int value = 1;
while (value < minimumValue && value < minimumValue) {
while (value < minimumValue && value < maximumValue) {
value <<= 1;
shift++;
}

Loading…
Cancel
Save