You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Rishabh Daim (Jira)" <ji...@apache.org> on 2025/02/01 15:59:00 UTC
[jira] [Commented] (OAK-11449) Remove usage of Guava Iterables.concat()
[ https://issues.apache.org/jira/browse/OAK-11449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922949#comment-17922949 ]
Rishabh Daim commented on OAK-11449:
------------------------------------
To concat {*}Iterables{*}, we have the following options available with us:
# Using *Stream.concat() OR Stream.flatMap():* We can use native Java Code to concat multiple Iterables via Stream API [1]. Still, it would require us to return any concrete implementation of the Iterable interface such as List/Set (after using {*}collect{*}) rather than an Iterable itself. This would result in some cases changing the type of actual iterable (which could be any collections class).
# Using *IterableUtils.chainedIterable:* Apache *commons-collections4* provides the utility to concat multiple streams via *IterableUtils.chainedIterable* [2] ** without changing the incoming iterable types. This is a replica of Guava's implementation.
cc [~reschke] [~baedke]
[1] [https://www.baeldung.com/java-combine-multiple-collections#using-java-8-stream-api]
[2] [https://www.baeldung.com/java-combine-multiple-collections#using-apache-commons-collections]
> Remove usage of Guava Iterables.concat()
> ----------------------------------------
>
> Key: OAK-11449
> URL: https://issues.apache.org/jira/browse/OAK-11449
> Project: Jackrabbit Oak
> Issue Type: Technical task
> Reporter: Rishabh Daim
> Assignee: Rishabh Daim
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)