8264976: Minor numeric bug in AbstractSplittableWithBrineGenerator.makeSplitsSpliterator

Reviewed-by: psandoz, jlaskey
This commit is contained in:
Aleksey Shipilev 2021-04-14 16:16:41 +00:00
parent 80026d81a4
commit 94067446ba

View File

@ -2436,7 +2436,7 @@ public class RandomSupport {
// designed to work even if SALT_SHIFT does not evenly divide 64
// (the number of bits in a long value).
long bits = nextLong();
long multiplier = (1 << SALT_SHIFT) - 1;
long multiplier = (1L << SALT_SHIFT) - 1;
long salt = multiplier << (64 - SALT_SHIFT);
while ((salt & multiplier) != 0) {
long digit = Math.multiplyHigh(bits, multiplier);