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

2023-01-23 Thread Stuart Marks
On Sat, 21 Jan 2023 19:38:16 GMT, Sergey Bylokhov wrote: >> Tagir F. Valeev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Whitespaces fixed >> - @implSpec added to shuffle(List) > > Filed, will create a PR soon. > https://bugs.openj

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

2023-01-21 Thread Tagir F . Valeev
On Sat, 21 Jan 2023 19:38:16 GMT, Sergey Bylokhov wrote: >> Tagir F. Valeev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Whitespaces fixed >> - @implSpec added to shuffle(List) > > Filed, will create a PR soon. > https://bugs.openj

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

2023-01-21 Thread Sergey Bylokhov
On Sat, 21 Jan 2023 18:31:28 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-21 Thread Sergey Bylokhov
On Wed, 18 Jan 2023 22:06:55 GMT, Tagir F. Valeev wrote: >> Tagir F. Valeev has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains four commits: >> >> - Copyright year and @since tag updated >> - Fixes according to review >> >>

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

2023-01-21 Thread Sergey Bylokhov
On Sat, 21 Jan 2023 18:31:28 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-21 Thread Joe Darcy
On Sat, 21 Jan 2023 18:31:28 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-21 Thread Tagir F . Valeev
On Sat, 21 Jan 2023 18:24:24 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/Collections.java line 464: >> >>> 462: * position, inclusive. >>> 463: * >>> 464: * @implSpec This method runs in linear time. If the specified >>> list does >> >> Please also con

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

2023-01-21 Thread Tagir F . Valeev
> 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, RandomGenera

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

2023-01-21 Thread Tagir F . Valeev
On Sat, 21 Jan 2023 18:02:38 GMT, Joe Darcy wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> @implSpec added > > src/java.base/share/classes/java/util/Collections.java line 464: > >> 462: * position, inclus

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

2023-01-21 Thread Joe Darcy
On Sat, 21 Jan 2023 08:26:31 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-21 Thread Tagir F . Valeev
> 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, RandomGenera

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

2023-01-18 Thread Stuart Marks
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-18 Thread Tagir F . Valeev
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-18 Thread Stuart Marks
On Sun, 15 Jan 2023 07:52:53 GMT, Tagir F. Valeev 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 >> conven

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

2023-01-14 Thread Tagir F . Valeev
On Wed, 4 Jan 2023 21:32:17 GMT, Stuart Marks wrote: >> A gentle ping: please review the change and the CSR. Thanks. > > @amaembo a couple comments on the test. > > The test should probably have `@key randomness` added to it. > > On 2022-10-28, @bplb wrote: >> jdk.test.lib.RandomFactory can be

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

2023-01-14 Thread Tagir F . Valeev
> 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, RandomGenera

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

2023-01-04 Thread Stuart Marks
On Sat, 3 Dec 2022 08:23:34 GMT, Tagir F. Valeev wrote: >> 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 o

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

2023-01-04 Thread Stuart Marks
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev 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 >> conven

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

2022-12-03 Thread Tagir F . Valeev
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev 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 >> conven

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

2022-10-31 Thread jmehrens
On Fri, 28 Oct 2022 23:18:00 GMT, Stuart Marks wrote: > I'm having difficulty imagining how SequencedCollection::replaceAll could > work or be useful. Obviously it's on List already. In Collections.java, it seems that the cases of AbstractSequentialList are handled like so: 1. Call toArray 2.

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

2022-10-28 Thread Brian Burkhalter
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev 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 >> conven

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

2022-10-28 Thread Stuart Marks
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev 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 >> conven

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

2022-10-17 Thread jmehrens
On Sat, 15 Oct 2022 07:30:54 GMT, Tagir F. Valeev wrote: > For unsorted sets like LinkedHashSet, it's unclear how to behave if > replaceAll returns identical elements. Throw an exception? Shrink the set > size via deduplication? I would assume the spec for replaceAll would be borrowed from Ma

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

2022-10-15 Thread Tagir F . Valeev
On Fri, 14 Oct 2022 02:20:43 GMT, jmehrens wrote: >> 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 crea

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

2022-10-13 Thread jmehrens
On Wed, 12 Oct 2022 13:26:29 GMT, Tagir F. Valeev 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 >> conven

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

2022-10-12 Thread Tagir F . Valeev
On Tue, 11 Oct 2022 02:00:40 GMT, Stuart Marks wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove Random -> ThreadLocalRandom change > > src/java.base/share/classes/java/util/Collections.java line 485: > >>

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

2022-10-12 Thread Tagir F . Valeev
> 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, RandomGenera

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

2022-10-12 Thread Tagir F . Valeev
On Tue, 11 Oct 2022 01:56:38 GMT, Stuart Marks 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 66: > >> 64:

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

2022-10-12 Thread Tagir F . Valeev
On Tue, 11 Oct 2022 01:48:41 GMT, Stuart Marks 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:

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

2022-10-10 Thread Stuart Marks
On Sat, 8 Oct 2022 15:35:14 GMT, Tagir F. Valeev 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 >> conveni

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

2022-10-10 Thread Stuart Marks
On Sat, 8 Oct 2022 15:35:14 GMT, Tagir F. Valeev 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 >> conveni

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

2022-10-10 Thread Stuart Marks
On Sat, 8 Oct 2022 15:35:14 GMT, Tagir F. Valeev 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 >> conveni

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

2022-10-08 Thread Tagir F . Valeev
> 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, RandomGenera

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface

2022-10-08 Thread Tagir F . Valeev
On Mon, 3 Oct 2022 21:46:09 GMT, Stuart Marks 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

Re: RFR: 8294693: Add Collections.shuffle overload that accepts RandomGenerator interface

2022-10-03 Thread Stuart Marks
On Sat, 1 Oct 2022 08:06:44 GMT, Tagir F. Valeev 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

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

2022-10-01 Thread Tagir F . Valeev
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