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:
@@ -387,7 +387,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
|
|||||||
protected static int calculateShift(int minimumValue, int maximumValue) {
|
protected static int calculateShift(int minimumValue, int maximumValue) {
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
int value = 1;
|
int value = 1;
|
||||||
while (value < minimumValue && value < minimumValue) {
|
while (value < minimumValue && value < maximumValue) {
|
||||||
value <<= 1;
|
value <<= 1;
|
||||||
shift++;
|
shift++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user