Fix ConcurrentReferenceHashMap max constraints

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

Issue: SPR-11720
This commit is contained in:
HejiaHo
2014-04-14 23:17:14 +08:00
committed by Phillip Webb
parent 5559209233
commit 16410cad4d

View File

@@ -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++;
}