On Thu, 9 Sep 2021 18:01:04 GMT, Jim Laskey <jlas...@openjdk.org> wrote:

> RandomSupport.AbstractSplittableWithBrineGenerator. makeSplitsSpliterator is 
> intending to create a salt from a random long. The salt should have random 
> letters of size 4 for each consecutive 4 bits and then the last 4 bits as ff, 
> i.e. all bits set. 
> 
> However the loop is never executed, the random bits are not used and the salt 
> is always the same. 
> 
> This condition is false on the first execution: 
> 
>   long multiplier = (1L << SALT_SHIFT) - 1; 
>   long salt = multiplier << (64 - SALT_SHIFT); 
>   while ((salt & multiplier) != 0) { 
> 
> 
> This can be corrected by changing: 
> 
>   while ((salt & multiplier) != 0) { 
> 
> to 
> 
>   while ((salt & multiplier) == 0) {

Marked as reviewed by rriggs (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/5449

Reply via email to