On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev <tval...@openjdk.org> wrote:

>> Java 17 added RandomGenerator interface. However, existing method 
>> Collections.shuffle accepts old java.util.Random class. While since Java 19, 
>> it's possible to use Random.from(RandomGenerator) wrapper, it would be more 
>> convenient to provide direct overload shuffle(List<?> list, RandomGenerator 
>> rnd).
>
> Tagir F. Valeev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fixes according to review
>   
>   1. Reduce duplication in tests
>   2. Use JumpableGenerator#copy() instead of create(1) in tests, as according 
> to the spec, seed can be ignored
>   3. Simplify documentation for shuffle(List, Random) to avoid duplication.

`jdk.test.lib.RandomFactory` can be used to generate a reproducible sequence of 
random numbers. An example of its use may be seen for example in 
`java/nio/file/Files/CopyAndMove.java`

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

PR: https://git.openjdk.org/jdk/pull/10520

Reply via email to