On Mon, 30 Oct 2023 15:38:35 GMT, Viktor Klang <vkl...@openjdk.org> wrote:
> This Pull-Request implements [JEP-461](https://openjdk.org/jeps/461) src/java.base/share/classes/java/util/stream/GathererOp.java line 95: > 93: public void accept(X x) { > 94: final var b = rightMost; > 95: (b == null ? (rightMost = new NodeBuilder.Builder<>()) : > b).accept(x); I think this code is unecessarily hard to read. var rightMost = this.rightMost; if (rightMost == null) { rightMost = this.rightMost = new NodeBuilder.Builder<>(); } rightMost.accept(x); src/java.base/share/classes/java/util/stream/GathererOp.java line 99: > 97: > 98: public NodeBuilder<X> join(NodeBuilder<X> that) { > 99: if (isEmpty()) Please add curly braces around if and if/else ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1386982341 PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1386984238