Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v25]

2023-09-07 Thread Viktor Klang
On Wed, 6 Sep 2023 13:07:10 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v29]

2023-09-11 Thread Viktor Klang
On Mon, 11 Sep 2023 16:54:30 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8315454: Add an immutable BitSet

2023-09-01 Thread Viktor Klang
On Fri, 1 Sep 2023 08:21:13 GMT, Per Minborg wrote: > This PR proposes adding a new method to BitSet that provides an immutable > snapshot of the set in the form of an `IntPredicate`. > > The predicate is eligible for constant folding. > > Here are some classes in the JDK that would benefit

Re: RFR: JDK-8314194: Reusing CyclicBarrier, it should be possible to change the barrierCommand

2023-08-31 Thread Viktor Klang
On Thu, 31 Aug 2023 06:59:29 GMT, David Holmes wrote: >> Sorry, my description in Issue JDK-8314194(which I submitted) is ambiguous >> and makes you think of Phaser. My intention is that each generation of >> CyclicBarrier barrierCommand can change. Let me give you a scenario >> For example,

Update on JEP-461: Stream Gatherers (Preview)

2023-10-27 Thread Viktor Klang
ture. [cid:d048f613-b144-4ff9-a2d3-98e0765aab57]<https://www.youtube.com/watch?v=8fMFa6OqlY8> Teaching old Streams new tricks By Viktor Klang<https://www.youtube.com/watch?v=8fMFa6OqlY8> Have you ever wanted to perform an operation on a java.util.stream.Stream only to find that the exist

Re: [External] : Re: Update on JEP-461: Stream Gatherers (Preview)

2023-10-30 Thread Viktor Klang
you could write things like: var neatlyFolded = stream.gather(fold(…)).collect(singleton()); Cheers, √ Viktor Klang Software Architect, Java Platform Group Oracle From: Tyler Kindy Sent: Monday, 30 October 2023 18:38 To: Viktor Klang Cc: core-libs-dev@openjdk.org Subject:

Re: [External] : Re: Update on JEP-461: Stream Gatherers (Preview)

2023-10-31 Thread Viktor Klang
1). Cheers, √ Viktor Klang Software Architect, Java Platform Group Oracle From: Remi Forax Sent: Monday, 30 October 2023 23:39 To: Viktor Klang Cc: Tyler Kindy ; core-libs-dev Subject: Re: [External] : Re: Update on JEP-461: Stream Gatherers (Preview

Integrated: JDK-8318467 : [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads

2023-10-31 Thread Viktor Klang
On Mon, 30 Oct 2023 14:54:08 GMT, Viktor Klang wrote: > Discussed with @DougLea and adjusting the queue capacity to at least the > number of participating threads seems like the most sensible fix. This pull request has now been integrated. Changeset: e05cafda Author:Viktor

Re: [External] : Re: Update on JEP-461: Stream Gatherers (Preview)

2023-10-30 Thread Viktor Klang
s they want, and choose the terminal operation when they need to break out from the Stream. Cheers, √ Viktor Klang Software Architect, Java Platform Group Oracle From: Tyler Kindy Sent: Monday, 30 October 2023 12:14 To: Viktor Klang Cc: core-libs-dev@openjdk.o

RFR: JDK-8318467 : [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads

2023-10-30 Thread Viktor Klang
Discussed with @DougLea and adjusting the queue capacity to at least the number of participating threads seems like the most sensible fix. - Commit messages: - Addressing 8318467 by adjusting queue capacity to at least the number of threads Changes:

Re: RFR: JDK-8318467 : [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads [v2]

2023-10-30 Thread Viktor Klang
> Discussed with @DougLea and adjusting the queue capacity to at least the > number of participating threads seems like the most sensible fix. Viktor Klang has updated the pull request incrementally with one additional commit since the last revision: Updating copyright year and adj

Re: RFR: JDK-8318467 : [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads

2023-10-30 Thread Viktor Klang
On Mon, 30 Oct 2023 15:01:02 GMT, Doug Lea wrote: >> Discussed with @DougLea and adjusting the queue capacity to at least the >> number of participating threads seems like the most sensible fix. > > Thanks for figuring out where to make the adjustment! Looks good. @DougLea Yeah it took some

Re: RFR: 8316924: java/lang/Thread/virtual/stress/ParkALot.java times out

2023-09-27 Thread Viktor Klang
On Wed, 27 Sep 2023 07:47:19 GMT, Alan Bateman wrote: > A test only change to a stress test for virtual thread parking/unparking to > limit execution time on a larger systems. Right run, the test bashes > parking/unparking for 1, 2, 3, ... up to the number of half the hardware > threads. It

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v49]

2023-10-12 Thread Viktor Klang
On Wed, 11 Oct 2023 13:07:08 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v49]

2023-10-12 Thread Viktor Klang
On Wed, 11 Oct 2023 13:07:08 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v49]

2023-10-12 Thread Viktor Klang
On Thu, 12 Oct 2023 16:53:12 GMT, Doug Lea wrote: >> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 3153: >> >>> 3151: public ForkJoinTask submit(Callable task) { >>> 3152: ForkJoinTask t = >>> 3153: (Thread.currentThread() instanceof

RFR: 8318421 : AbstractPipeline.sourceStageSpliterator() chases pointers needlessly

2023-10-19 Thread Viktor Klang
Removes a few unnecessary dereferences of `sourceStage`. - Commit messages: - Avoiding unnecessary pointer-chasing in sourceStageSpliterator() and avoiding a check-then-act in close() Changes: https://git.openjdk.org/jdk/pull/16241/files Webrev:

Re: RFR: 8318420 : AbstractPipeline invokes overridden method in constructor

2023-10-19 Thread Viktor Klang
On Wed, 18 Oct 2023 09:45:53 GMT, Viktor Klang wrote: > This PR corrects so that `opIsStateful()` is not invoked as a part of the > java.util.stream.AbstractPipeline constructor—as `opIsStateful()` is intended > to be overridden by subclasses, and as their own constructors have not ru

Re: RFR: 8318421 : AbstractPipeline.sourceStageSpliterator() chases pointers needlessly

2023-10-19 Thread Viktor Klang
On Wed, 18 Oct 2023 10:14:08 GMT, Viktor Klang wrote: > Removes a few unnecessary dereferences of `sourceStage`. @PaulSandoz Care to review this one? :) - PR Comment: https://git.openjdk.org/jdk/pull/16241#issuecomment-1768129782

Re: RFR: 8318420 : AbstractPipeline invokes overridden method in constructor

2023-10-19 Thread Viktor Klang
On Wed, 18 Oct 2023 09:45:53 GMT, Viktor Klang wrote: > This PR corrects so that `opIsStateful()` is not invoked as a part of the > java.util.stream.AbstractPipeline constructor—as `opIsStateful()` is intended > to be overridden by subclasses, and as their own constructors have not ru

RFR: 8318420 : AbstractPipeline invokes overridden method in constructor

2023-10-19 Thread Viktor Klang
This PR corrects so that `opIsStateful()` is not invoked as a part of the java.util.stream.AbstractPipeline constructor—as `opIsStateful()` is intended to be overridden by subclasses, and as their own constructors have not run when their superclass constructor runs, this means that

Integrated: 8318421 : AbstractPipeline.sourceStageSpliterator() chases pointers needlessly

2023-10-20 Thread Viktor Klang
On Wed, 18 Oct 2023 10:14:08 GMT, Viktor Klang wrote: > Removes a few unnecessary dereferences of `sourceStage`. This pull request has now been integrated. Changeset: 21215753 Author: Viktor Klang Committer: Paul Sandoz URL: https://git.openjdk.org/jdk/com

Integrated: 8318420 : AbstractPipeline invokes overridden method in constructor

2023-10-20 Thread Viktor Klang
On Wed, 18 Oct 2023 09:45:53 GMT, Viktor Klang wrote: > This PR corrects so that `opIsStateful()` is not invoked as a part of the > java.util.stream.AbstractPipeline constructor—as `opIsStateful()` is intended > to be overridden by subclasses, and as their own constructors have not ru

Re: RFR: 8293713 : java/net/httpclient/BufferingSubscriberTest.java fails in timeout, blocked in submission publisher

2023-10-23 Thread Viktor Klang
On Mon, 23 Oct 2023 15:28:31 GMT, Viktor Klang wrote: > Resolves a visibility issue in SubmissionPublisher by making the `waiter` > member of BufferedSubscription *volatile*. Discussed this change with @DougLea - PR Comment: https://git.openjdk.org/jdk/pull/16313#issuec

RFR: 8293713 : java/net/httpclient/BufferingSubscriberTest.java fails in timeout, blocked in submission publisher

2023-10-23 Thread Viktor Klang
Resolves a visibility issue in SubmissionPublisher by making the `waiter` member of BufferedSubscription *volatile*. - Commit messages: - Addresses JDK-8293713 by making the waiter thread member volatile Changes: https://git.openjdk.org/jdk/pull/16313/files Webrev:

Re: RFR: 8293713 : java/net/httpclient/BufferingSubscriberTest.java fails in timeout, blocked in submission publisher

2023-10-23 Thread Viktor Klang
On Mon, 23 Oct 2023 15:28:31 GMT, Viktor Klang wrote: > Resolves a visibility issue in SubmissionPublisher by making the `waiter` > member of BufferedSubscription *volatile*. @AlanBateman @stuart-marks Does any of you have any cycles to review this one-word PR? :) - PR C

Integrated: 8293713 : java/net/httpclient/BufferingSubscriberTest.java fails in timeout, blocked in submission publisher

2023-10-24 Thread Viktor Klang
On Mon, 23 Oct 2023 15:28:31 GMT, Viktor Klang wrote: > Resolves a visibility issue in SubmissionPublisher by making the `waiter` > member of BufferedSubscription *volatile*. This pull request has now been integrated. Changeset: 5224e979 Author:Viktor Klang Committer: Alan Batema

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v4]

2023-08-17 Thread Viktor Klang
On Mon, 14 Aug 2023 11:52:00 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v4]

2023-08-15 Thread Viktor Klang
On Mon, 14 Aug 2023 11:52:00 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v4]

2023-08-17 Thread Viktor Klang
On Mon, 14 Aug 2023 11:52:00 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: 8314515: java/util/concurrent/SynchronousQueue/Fairness.java failed with "Error: fair=false i=8 j=0"

2023-08-18 Thread Viktor Klang
On Thu, 17 Aug 2023 22:35:39 GMT, Martin Buchholz wrote: > The usual tiny improvements, with no guarantee that the intermittent test > failure is actually fixed. test/jdk/java/util/concurrent/SynchronousQueue/Fairness.java line 41: > 39: throws Throwable > 40: { > 41: int

Re: RFR: 8288899: java/util/concurrent/ExecutorService/CloseTest.java failed with "InterruptedException: sleep interrupted" [v4]

2023-08-17 Thread Viktor Klang
On Mon, 14 Aug 2023 11:52:00 GMT, Doug Lea wrote: >> Addresses Jdk 8288899 : java/util/concurrent/ExecutorService/CloseTest.java >> failed with "InterruptedException: sleep interrupted" and related issues. >> >> This is a major ForkJoin update (and hard to review -- sorry) that finally >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 16:39:33 GMT, Tagir F. Valeev wrote: >> That's a good question, and here's my thinking—`scanRight` doesn't make any >> sense for a construct which supports unboundedness, so if we were discussing >> *Collections* I'd be more inclined to agree (but it is more likely that >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 17:20:56 GMT, Rémi Forax wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 444: > >> 442: */ >> 443: static Gatherer of( >> 444: Supplier initializer, > >

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Sun, 5 Nov 2023 16:43:33 GMT, Tagir F. Valeev wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/GathererOp.java line 162: > >> 160: * consideration at this point doesn't yield any >> performance

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 19:46:42 GMT, Alan Bateman wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 38: > >> 36: /** >> 37: * An intermediate operation that transforms a stream of input elements >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-08 Thread Viktor Klang
On Sun, 5 Nov 2023 16:38:38 GMT, Tagir F. Valeev wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-08 Thread Viktor Klang
> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) Viktor Klang has updated the pull request incrementally with two additional commits since the last revision: - Addressing review feedback - Make Gatherer.andThen take a wildcard for the rhs Gatherer state t

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 18:04:07 GMT, Rémi Forax wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherers.java line 64: > >> 62: *needlessly >> 63: * 3. allows for more efficient composition and evaluation

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 16:37:45 GMT, Tagir F. Valeev wrote: >> TBH I don't think `foldRight` makes much sense for potentially unbounded >> structures such as Stream. In the case you need it, it might be better to >> export it to a List and then reversing it. > > Well, the unboundness argument does

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 17:03:38 GMT, Rémi Forax wrote: >> src/java.base/share/classes/java/util/stream/AbstractPipeline.java line 242: >> >>> 240: } >>> 241: >>> 242: // Terminal evaluation methods >> >> This is needed in order to let subclasses override terminal operations such >> as,

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 17:56:09 GMT, Rémi Forax wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/GathererOp.java line 448: > >> 446: private final long targetSize; >> 447: private final Hybrid

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 19:52:53 GMT, Alan Bateman wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 194: > >> 192: * this gathering operation. >> 193: * >> 194: * By default, this method

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 21:04:47 GMT, Viktor Klang wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > Viktor Klang has updated the pull request incrementally with two additional > commits since the last revision: > > - Addressing revi

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 17:19:56 GMT, Tagir F. Valeev wrote: >> In that case the integrator should be a BiConsumer too, no ? > > @forax I thought so initially, but this is not so easy, as there's a `Greedy` > subinterface. If you adapt the `Integrator`, you will lose the ability to > specify the

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 17:26:35 GMT, Rémi Forax wrote: >> src/java.base/share/classes/java/util/stream/Gatherer.java line 490: >> >>> 488: * more elements sent to it, {@code false} if otherwise >>> 489: */ >>> 490: default boolean isRejecting() { return false; } >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 17:24:45 GMT, Rémi Forax wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 530: > >> 528: * @param the type of results this integrator can produce >> 529: */ >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 21:08:03 GMT, Viktor Klang wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > Viktor Klang has updated the pull request incrementally with two additional > commits since the last revision: > > - Addressing revi

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) Viktor Klang has updated the pull request incrementally with two additional commits since the last revision: - Multiple improvements to Gatherer and Gatherers javadoc and restructuring of Gatherers.java to put pub

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 09:38:51 GMT, Tagir F. Valeev wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 09:31:50 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/stream/Gatherer.java line 306: >> >>> 304: * @param the type of input elements for the new gatherer >>> 305: * @param the type of results for the new gatherer >>> 306: * @throws

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 08:28:37 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/stream/Gatherer.java line 509: >> >>> 507: @PreviewFeature(feature = PreviewFeature.Feature.STREAM_GATHERERS) >>> 508: interface Integrator { >>> 509: /** Integrate is the method which

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 08:15:02 GMT, Per Minborg wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 17:10:56 GMT, Daniel Fuchs wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Multiple improvements to Gatherer and Gatherers javadoc and restructuring >> o

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Wed, 8 Nov 2023 17:15:11 GMT, Rémi Forax wrote: >> @amaembo In this case, given that it is intended as Preview, I think it >> makes sense to receive some user feedback on this. Note that Collector has >> been without PECS for Collector.of since 1.8: >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 16:25:44 GMT, Alan Bateman wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Multiple improvements to Gatherer and Gatherers javadoc and restructuring >> o

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 09:32:17 GMT, Viktor Klang wrote: >> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) > > Viktor Klang has updated the pull request incrementally with two additional > commits since the last revision: > > - Multiple imp

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 17:21:23 GMT, Daniel Fuchs wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Multiple improvements to Gatherer and Gatherers javadoc and restructuring >> o

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 17:34:48 GMT, Daniel Fuchs wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Multiple improvements to Gatherer and Gatherers javadoc and restructuring >> o

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 09:39:33 GMT, Tagir F. Valeev wrote: >> Ah, now I see what you mean. In this specific case you might be able to >> create a combiner (which would also need a Downstream) such that you can add >> the missing combinations (the end of the "left" and the beginning of the >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Wed, 8 Nov 2023 17:11:39 GMT, Rémi Forax wrote: >> The API should be client-friendly, not implementor-friendly, given that it's >> expected to have much more clients than implementors. An implementor can >> easily delegate to a private method to add missing type parameters. I did >>

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 09:40:34 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/stream/Gatherers.java line 426: >> >>> 424: * transformation for scenarios where no combiner-function can be >>> 425: * implemented, or for reductions which are intrinsically >>> 426:

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v3]

2023-11-10 Thread Viktor Klang
On Fri, 10 Nov 2023 16:48:34 GMT, Alan Bateman wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Multiple improvements to Gatherer and Gatherers javadoc and restructuring >> o

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 14:21:55 GMT, Alan Bateman wrote: >> You mean "Returns a Gatherer which gathers elements into ..." ? > > Is "window" defined anywhere? If you are doing another pass over the docs > then the windowXXX methods could be expanded a bit to explain this grouping > concept. Also it

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 08:01:28 GMT, Per Minborg wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 12:37:30 GMT, Per Minborg wrote: >> Which parameters? The type parameters or the method parameters? > > Here is an example: > > > static Collector of(Supplier supplier, > BiConsumer accumulator, >

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 14:41:10 GMT, Alan Bateman wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 07:57:27 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/stream/Gatherer.java line 216: >> >>> 214: >>> 215: /** >>> 216: * A function which accepts two intermediate states and combines >>> them into >> >> We could use a {@return ..} here. There

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Wed, 8 Nov 2023 17:36:42 GMT, Rémi Forax wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

2023-11-09 Thread Viktor Klang
On Thu, 9 Nov 2023 14:26:40 GMT, Alan Bateman wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Addressing review feedback >> - Make Gatherer.andThen take a wildcard for the r

RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
This is a Draft PR for [JEP-461](https://openjdk.org/jeps/461) - Commit messages: - Updating Javadoc for Gatherer and Gatherers based - Addressing feedback on Gatherers - Removing Gatherers.peek() and Gatherers.peekOrdered() - Updates after review comments - Removing trailing

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Fri, 3 Nov 2023 14:04:23 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/util/stream/AbstractPipeline.java line 88: >> >>> 86: */ >>> 87: @SuppressWarnings("rawtypes") >>> 88: protected final AbstractPipeline previousStage; >> >> Making this accessible in subclasses

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 1 Nov 2023 15:40:23 GMT, Brian Goetz wrote: >Since you validate that previous^2.next == previous, you might just omit the >previousStage parameter and derive it in the body. @briangoetz It was a bit of additional safety to make sure that the caller gets what they want. If the

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Sun, 5 Nov 2023 17:55:39 GMT, Tagir F. Valeev wrote: >> This is a Draft PR for [JEP-461](https://openjdk.org/jeps/461) > > Very solid work, thank you! See some minor comments inline. I actually have > much more ideas of specific gatherers, but they could be discussed separately. > > One

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang wrote: > This is a Draft PR for [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/AbstractPipeline.java line 88: > 86: */ > 87: @SuppressWarnings("rawtypes") > 88: protected

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Mon, 6 Nov 2023 16:57:24 GMT, ExE Boss wrote: > These should probably use `{@snippet ...}`: Good idea—I might do so when I have the opportunity. > src/java.base/share/classes/java/util/stream/Gatherer.java line 549: > >> 547: return greedy; >> 548: } >> 549: > > Since 

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 14:19:47 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/stream/Gatherer.java line 252: >> >>> 250: * Gatherer as input that Gatherer >>> 251: */ >>> 252: default Gatherer andThen(Gatherer>> AA, ? extends RR> that) { >> >> It would

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 1 Nov 2023 16:16:38 GMT, Brian Goetz wrote: >> This is a Draft PR for [JEP-461](https://openjdk.org/jeps/461) > > src/java.base/share/classes/java/util/stream/Gatherer.java line 137: > >> 135: * }) >> 136: * ); >> 137: * } > > As a matter of style, I find it weird that

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 14:14:35 GMT, Tagir F. Valeev wrote: >> I've thought about that, and since we don't use that for the other >> parameters (like `initializer`) I don't think it helps changing it here. And >> the reason this has little effect is that the code calling the factory >> typically

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 1 Nov 2023 18:10:28 GMT, Viktor Klang wrote: >> src/java.base/share/classes/java/util/stream/Gatherers.java line 516: >> >>> 514: * evaluation can be out-of-sequence compared to the sequential >>> encounter >>> 515: * order of the

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 1 Nov 2023 17:22:09 GMT, Viktor Klang wrote: >> Since you validate that previous^2.next == previous, you might just omit the >> `previousStage` parameter and derive it in the body. > >>Since you validate that previous^2.next == previous, you might just omit

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 16:28:55 GMT, Tagir F. Valeev wrote: >> Perhaps the best thing here is to change such that the supplier supplies >> something non-zero like "String: "? > > Such an example still looks artificial for me, as it's easy to rewrite with > `reduce()` (just prepend with prefix

Re: RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview)

2023-11-08 Thread Viktor Klang
On Wed, 8 Nov 2023 16:26:56 GMT, Tagir F. Valeev wrote: >> @amaembo pairMap should be straight-forward to implement. And regarding >> parallelization I don't think that will necessarily work since it would not >> be able to run incrementally (depth-first). > > Sorry, I'm not sure what do you

Re: RFR: 8279361: Error in documentation of third Stream.reduce method

2022-09-29 Thread Viktor Klang
On Thu, 29 Sep 2022 16:29:54 GMT, Paul Sandoz wrote: >> This JavaDoc change attempts to shine some light on the `combiner`-function >> as it relates to the third variant of `Stream.reduce` since it according to >> the bug submission in JBS can be confusing that the `combiner` is not >>

Re: RFR: 8279361: Error in documentation of third Stream.reduce method

2022-09-30 Thread Viktor Klang
On Fri, 30 Sep 2022 00:44:01 GMT, Stuart Marks wrote: >> This JavaDoc change attempts to shine some light on the `combiner`-function >> as it relates to the third variant of `Stream.reduce` since it according to >> the bug submission in JBS can be confusing that the `combiner` is not >>

Re: RFR: 8279361: Error in documentation of third Stream.reduce method [v3]

2022-10-03 Thread Viktor Klang
> This JavaDoc change attempts to shine some light on the `combiner`-function > as it relates to the third variant of `Stream.reduce` since it according to > the bug submission in JBS can be confusing that the `combiner` is not > mentioned in the code example in the documentation.

Re: RFR: 8279361: Error in documentation of third Stream.reduce method [v2]

2022-10-03 Thread Viktor Klang
> This JavaDoc change attempts to shine some light on the `combiner`-function > as it relates to the third variant of `Stream.reduce` since it according to > the bug submission in JBS can be confusing that the `combiner` is not > mentioned in the code example in the documentation.

Re: RFR: 8279361: Error in documentation of third Stream.reduce method

2022-10-03 Thread Viktor Klang
On Fri, 30 Sep 2022 21:34:44 GMT, Stuart Marks wrote: >> This JavaDoc change attempts to shine some light on the `combiner`-function >> as it relates to the third variant of `Stream.reduce` since it according to >> the bug submission in JBS can be confusing that the `combiner` is not >>

RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections

2023-01-04 Thread Viktor Klang
Currently Set.copyOf allocates both a HashSet and a new empty array when the input collection is empty. This patch avoids allocating anything for the case where the parameter collection's isEmpty returns true. - Commit messages: - 8299444: java.util.Set.copyOf allocates

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections

2023-01-04 Thread Viktor Klang
On Wed, 4 Jan 2023 15:20:10 GMT, Pavel Rappo wrote: >> Currently Set.copyOf allocates both a HashSet and a new empty array when the >> input collection is empty. >> >> This patch avoids allocating anything for the case where the parameter >> collection's isEmpty returns true. > > Curious: how

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections

2023-01-05 Thread Viktor Klang
On Thu, 5 Jan 2023 01:02:11 GMT, Sergey Bylokhov wrote: >> There's no regression test. However, with the current code (prior to this >> change) a call to `Set.of(zeroLengthArray)` returns the same instance as >> `Set.of()`, so it's difficult to write a simple functional test for this >>

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-09 Thread Viktor Klang
> Currently Set.copyOf allocates both a HashSet and a new empty array when the > input collection is empty. > > This patch avoids allocating anything for the case where the parameter > collection's isEmpty returns true. Viktor Klang has updated the pull request increme

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections

2023-01-09 Thread Viktor Klang
On Thu, 5 Jan 2023 01:02:11 GMT, Sergey Bylokhov wrote: >> There's no regression test. However, with the current code (prior to this >> change) a call to `Set.of(zeroLengthArray)` returns the same instance as >> `Set.of()`, so it's difficult to write a simple functional test for this >>

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-09 Thread Viktor Klang
On Mon, 9 Jan 2023 17:09:02 GMT, Sergey Bylokhov wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - 8299444: java.util.Set.copyOf allocates needlessly for empty input >> collect

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-09 Thread Viktor Klang
On Mon, 9 Jan 2023 18:34:57 GMT, Per Minborg wrote: >> Viktor Klang has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - 8299444: java.util.Set.copyOf allocates needlessly for empty input >> collect

Re: RFR: 8297495: j.u.concurrent updates for JDK 20 [v2]

2022-12-05 Thread Viktor Klang
On Thu, 1 Dec 2022 14:46:48 GMT, Alan Bateman wrote: >> The proposed updates for JDK 20 are: >> >> - ForkJoinPool.externalSubmit >> - ForkJoinWorkerThread.getQueuedTaskCount >> >> These methods will be used to improve the Thread.yield implementation for >> virtual threads. The range of

Re: RFR: 8297495: j.u.concurrent updates for JDK 20 [v2]

2022-12-05 Thread Viktor Klang
On Mon, 5 Dec 2022 10:33:38 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 2920: >> >>> 2918: * @since 20 >>> 2919: */ >>> 2920: public ForkJoinTask externalSubmit(ForkJoinTask task) { >> >> @AlanBateman Does it make sense to

Re: RFR: 8300647: Miscellaneous hashCode improvements in java.base [v2]

2023-01-19 Thread Viktor Klang
On Thu, 19 Jan 2023 13:46:26 GMT, Claes Redestad wrote: >> Went through the jdk and found a few more places where >> `ArraysSupport::vectorizedHashCode` can be used, and a few where adhoc >> methods could be replaced with a plain call to `java.util.Arrays` >> equivalents. This patch addresses

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v4]

2023-01-24 Thread Viktor Klang
> Currently Set.copyOf allocates both a HashSet and a new empty array when the > input collection is empty. > > This patch avoids allocating anything for the case where the parameter > collection's isEmpty returns true. Viktor Klang has updated the pull request increme

Re: RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections [v2]

2023-01-24 Thread Viktor Klang
On Tue, 24 Jan 2023 11:07:07 GMT, Rémi Forax wrote: >> @stuart-marks Sorry, missed this notification. I initially had the same >> idea, but decided against it because it forces me to suppress "rawtypes" >> since `coll instanceof ListN` is not considered to be a rawtype, but `coll >>

  1   2   3   4   5   >