Skip to content

Commit fb65e14

Browse files
rishabhdaimRishabh Kumar
authored andcommitted
OAK-11430 : removed usage of Guava Iterables.all (apache#2026)
Co-authored-by: Rishabh Kumar <diam@adobe.com>
1 parent 8a1266a commit fb65e14

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/VersionGarbageCollector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.util.function.Supplier;
4343
import java.util.stream.StreamSupport;
4444

45+
import org.apache.commons.collections4.IterableUtils;
4546
import org.apache.jackrabbit.guava.common.base.Stopwatch;
4647
import org.apache.jackrabbit.guava.common.collect.Iterators;
4748
import org.apache.jackrabbit.oak.commons.sort.StringSort;
@@ -75,7 +76,6 @@
7576
import static java.util.stream.Collectors.toMap;
7677
import static java.util.stream.Collectors.toSet;
7778

78-
import static org.apache.jackrabbit.guava.common.collect.Iterables.all;
7979
import static org.apache.jackrabbit.guava.common.collect.Iterators.partition;
8080
import static java.util.concurrent.TimeUnit.MICROSECONDS;
8181
import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES;
@@ -2304,7 +2304,7 @@ private Iterator<String> previousDocIdsFor(NodeDocument doc) {
23042304
Map<Revision, Range> prevRanges = doc.getPreviousRanges(true);
23052305
if (prevRanges.isEmpty()) {
23062306
return Collections.emptyIterator();
2307-
} else if (all(prevRanges.values(), FIRST_LEVEL::test)) {
2307+
} else if (IterableUtils.matchesAll(prevRanges.values(), FIRST_LEVEL::test)) {
23082308
// all previous document ids can be constructed from the
23092309
// previous ranges map. this works for first level previous
23102310
// documents only.

oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BackgroundWriteTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121

22+
import org.apache.commons.collections4.IterableUtils;
2223
import org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore;
2324
import org.junit.Test;
2425

25-
import static org.apache.jackrabbit.guava.common.collect.Iterables.all;
2626
import static org.apache.jackrabbit.oak.plugins.document.TestUtils.IS_LAST_REV_UPDATE;
2727
import static org.junit.Assert.assertTrue;
2828

@@ -64,7 +64,7 @@ private static final class TestStore extends MemoryDocumentStore {
6464
@Override
6565
public <T extends Document> List<T> createOrUpdate(Collection<T> collection,
6666
List<UpdateOp> updateOps) {
67-
if (all(updateOps, IS_LAST_REV_UPDATE::test)) {
67+
if (IterableUtils.matchesAll(updateOps, IS_LAST_REV_UPDATE::test)) {
6868
assertTrue(updateOps.size() <= UnsavedModifications.BACKGROUND_MULTI_UPDATE_LIMIT);
6969
}
7070
return super.createOrUpdate(collection, updateOps);

0 commit comments

Comments
 (0)