This is an automated email from the ASF dual-hosted git repository.

daim pushed a commit to branch OAK-11430
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 87528a95ced337ff2f9067e549524c8c98b2d6e3
Author: Rishabh Kumar <d...@adobe.com>
AuthorDate: Fri Jan 24 20:05:25 2025 +0530

    OAK-11430 : removed usage of Guava Iterables.all
---
 .../jackrabbit/oak/plugins/document/VersionGarbageCollector.java      | 4 ++--
 .../apache/jackrabbit/oak/plugins/document/BackgroundWriteTest.java   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
index ad89f442ab..18c544a495 100644
--- 
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
+++ 
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java
@@ -42,6 +42,7 @@ import java.util.function.Predicate;
 import java.util.function.Supplier;
 import java.util.stream.StreamSupport;
 
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.jackrabbit.guava.common.base.Stopwatch;
 import org.apache.jackrabbit.guava.common.collect.Iterators;
 import org.apache.jackrabbit.oak.commons.sort.StringSort;
@@ -75,7 +76,6 @@ import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toMap;
 import static java.util.stream.Collectors.toSet;
 
-import static org.apache.jackrabbit.guava.common.collect.Iterables.all;
 import static org.apache.jackrabbit.guava.common.collect.Iterators.partition;
 import static java.util.concurrent.TimeUnit.MICROSECONDS;
 import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES;
@@ -2304,7 +2304,7 @@ public class VersionGarbageCollector {
             Map<Revision, Range> prevRanges = doc.getPreviousRanges(true);
             if (prevRanges.isEmpty()) {
                 return Collections.emptyIterator();
-            } else if (all(prevRanges.values(), FIRST_LEVEL::test)) {
+            } else if (IterableUtils.matchesAll(prevRanges.values(), 
FIRST_LEVEL::test)) {
                 // all previous document ids can be constructed from the
                 // previous ranges map. this works for first level previous
                 // documents only.
diff --git 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BackgroundWriteTest.java
 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BackgroundWriteTest.java
index 5e64c7ebae..2f25660234 100644
--- 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BackgroundWriteTest.java
+++ 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BackgroundWriteTest.java
@@ -19,10 +19,10 @@ package org.apache.jackrabbit.oak.plugins.document;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.collections4.IterableUtils;
 import org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore;
 import org.junit.Test;
 
-import static org.apache.jackrabbit.guava.common.collect.Iterables.all;
 import static 
org.apache.jackrabbit.oak.plugins.document.TestUtils.IS_LAST_REV_UPDATE;
 import static org.junit.Assert.assertTrue;
 
@@ -64,7 +64,7 @@ public class BackgroundWriteTest {
         @Override
         public <T extends Document> List<T> createOrUpdate(Collection<T> 
collection,
                                                            List<UpdateOp> 
updateOps) {
-            if (all(updateOps, IS_LAST_REV_UPDATE::test)) {
+            if (IterableUtils.matchesAll(updateOps, IS_LAST_REV_UPDATE::test)) 
{
                 assertTrue(updateOps.size() <= 
UnsavedModifications.BACKGROUND_MULTI_UPDATE_LIMIT);
             }
             return super.createOrUpdate(collection, updateOps);

Reply via email to