This is an automated email from the ASF dual-hosted git repository. daim pushed a commit to branch OAK-11558 in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 0321a91b64aeefb38bb7f1d8a93b1614144c09d4 Author: Rishabh Kumar <[email protected]> AuthorDate: Fri Mar 7 12:51:37 2025 +0530 OAK-11558 : removed usage of Guava's Iterables.tryFind with Streams --- .../jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java index 0cb16d0d63..e3dcb772b2 100644 --- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java +++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java @@ -65,6 +65,7 @@ import org.apache.jackrabbit.oak.commons.collections.IterableUtils; import org.apache.jackrabbit.oak.commons.collections.ListUtils; import org.apache.jackrabbit.oak.commons.collections.MapUtils; import org.apache.jackrabbit.oak.commons.collections.SetUtils; +import org.apache.jackrabbit.oak.commons.collections.StreamUtils; import org.apache.jackrabbit.oak.plugins.document.Collection; import org.apache.jackrabbit.oak.plugins.document.Document; import org.apache.jackrabbit.oak.plugins.document.DocumentStore; @@ -470,7 +471,7 @@ public class MongoDocumentStore implements DocumentStore { if (mongoStatus.isVersion(4, 2)) { options.storageEngineOptions(MongoDBConfig.getCollectionStorageOptions(mongoStorageOptions)); - if (!Iterables.tryFind(db.listCollectionNames(), s -> Objects.equals(collectionName, s)).isPresent()) { + if (StreamUtils.toStream(db.listCollectionNames()).noneMatch(s -> Objects.equals(collectionName, s))) { db.createCollection(collectionName, options); LOG.info("Creating Collection {}, with collection storage options", collectionName); }
