pjfanning commented on code in PR #3194:
URL: https://github.com/apache/pekko/pull/3194#discussion_r3481236016
##########
docs/src/test/java/jdocs/stream/operators/flow/StatefulMap.java:
##########
@@ -47,8 +47,7 @@ public void bufferUntilChanged() {
(buffer, element) -> {
if (buffer.size() > 0 && (!buffer.get(0).equals(element))) {
return Pair.create(
- new LinkedList<>(Collections.singletonList(element)),
- Collections.unmodifiableList(buffer));
+ new LinkedList<>(Collections.singletonList(element)),
List.copyOf(buffer));
Review Comment:
Why keep Collections.singletonList(element)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]