This is an automated email from the ASF dual-hosted git repository.
daim pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 043165b343 OAK-11558 : removed usage of Guava's Iterables.tryFind with
Streams (#2148)
043165b343 is described below
commit 043165b34349db23a8c0c2c007a44aa375e10caf
Author: Rishabh Kumar <[email protected]>
AuthorDate: Fri Mar 7 17:42:05 2025 +0530
OAK-11558 : removed usage of Guava's Iterables.tryFind with Streams (#2148)
Co-authored-by: Rishabh Kumar <[email protected]>
---
.../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);
}