8273162: AbstractSplittableWithBrineGenerator does not create a random salt

Reviewed-by: rriggs, bpb
This commit is contained in:
Jim Laskey 2021-09-10 18:03:45 +00:00
parent d4177a98c1
commit 5e1df2c7d7

View File

@ -2380,7 +2380,7 @@ public class RandomSupport {
long bits = nextLong();
long multiplier = (1L << SALT_SHIFT) - 1;
long salt = multiplier << (64 - SALT_SHIFT);
while ((salt & multiplier) != 0) {
while ((salt & multiplier) == 0) {
long digit = Math.multiplyHigh(bits, multiplier);
salt = (salt >>> SALT_SHIFT) | (digit << (64 - SALT_SHIFT));
bits *= multiplier;