RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface [v2]

Tagir F. Valeev tvaleev at openjdk.org
Wed Oct 12 13:02:07 UTC 2022


On Tue, 11 Oct 2022 01:48:41 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> Tagir F. Valeev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove Random -> ThreadLocalRandom change
>
> test/jdk/java/util/Collections/Shuffle.java line 92:
> 
>> 90:             throw new RuntimeException(list.getClass() + ": " + list + " != " + copy);
>> 91:         }
>> 92:     }
> 
> Is there a way to factor out the `shuffle` calls and thereby collapse these two methods into one? Is it worth it? I'm thinking you could pass in a `Consumer<List<Integer>>`.

Good idea, thanks! Will do.

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

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


More information about the core-libs-dev mailing list