Skip to content

Commit

Permalink
Fix ConcurrentReferenceHashMap max constraints
Browse files Browse the repository at this point in the history
Update calculateShift to respect the maximum upper bound as well as the
minimum value.

Issue: SPR-11720

(cherry picked from commit 16410ca)
  • Loading branch information
HejiaHo authored and Phillip Webb committed Apr 22, 2014
1 parent ffaac0e commit ac85eab
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -383,7 +383,7 @@ private Segment getSegmentForHash(int hash) {
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++;
}
Expand Down

0 comments on commit ac85eab

Please sign in to comment.