You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2024/10/25 19:21:52 UTC

(jackrabbit-oak) branch trunk updated: OAK-11222: Remove usage of Guava newArrayList (no param variant)

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

reschke 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 ad0edfd4dc OAK-11222: Remove usage of Guava newArrayList (no param variant)
ad0edfd4dc is described below

commit ad0edfd4dc39be17a490cbd222cf3a0fc19d9688
Author: Julian Reschke <re...@apache.org>
AuthorDate: Fri Oct 25 20:21:43 2024 +0100

    OAK-11222: Remove usage of Guava newArrayList (no param variant)
---
 .../org/apache/jackrabbit/oak/spi/commit/BackgroundObserverTest.java | 5 ++---
 .../jackrabbit/oak/plugins/index/lucene/IndexStatisticsTest.java     | 2 +-
 .../index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java    | 3 +--
 .../jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java       | 2 +-
 .../apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java | 2 +-
 .../oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java  | 5 +++--
 6 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserverTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserverTest.java
index a1e75ae6bc..295baf5adb 100644
--- a/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserverTest.java
+++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserverTest.java
@@ -46,11 +46,10 @@ import org.jetbrains.annotations.NotNull;
 import org.junit.After;
 import org.junit.Test;
 
-import org.apache.jackrabbit.guava.common.collect.Lists;
-
 import junit.framework.AssertionFailedError;
 
 public class BackgroundObserverTest {
+
     private static final CommitInfo COMMIT_INFO = new CommitInfo("no-session", null);
     public static final int CHANGE_COUNT = 1024;
 
@@ -113,7 +112,7 @@ public class BackgroundObserverTest {
         return new BackgroundObserver(new Observer() {
             // Need synchronised list here to maintain correct memory barrier
             // when this is passed on to done(List<Runnable>)
-            final List<Runnable> assertions = Collections.synchronizedList(Lists.<Runnable> newArrayList());
+            final List<Runnable> assertions = Collections.synchronizedList(new ArrayList<>());
             volatile NodeState previous;
 
             @Override
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexStatisticsTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexStatisticsTest.java
index 635ed288ca..9074828586 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexStatisticsTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexStatisticsTest.java
@@ -149,7 +149,7 @@ public class IndexStatisticsTest {
     }
 
     private static Directory createSampleDirectory(long numOfDocs) throws IOException {
-        return createSampleDirectory(numOfDocs, Lists.newArrayList());
+        return createSampleDirectory(numOfDocs, Collections.emptyList());
     }
 
     private static Directory createSampleDirectory(Document moreDoc) throws IOException {
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java
index 1d9a7a716d..30a2117c61 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.oak.plugins.index.lucene.directory;
 
 import org.apache.jackrabbit.guava.common.collect.Iterables;
-import org.apache.commons.compress.utils.Lists;
 import org.apache.jackrabbit.oak.InitialContentHelper;
 import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser;
 import org.apache.jackrabbit.oak.commons.junit.TemporarySystemProperty;
@@ -69,7 +68,7 @@ public class ConcurrentCopyOnReadDirectoryTest {
 
     private Directory firstCoR = null;
     private List<Future<String>> leechingCoRFutures = new ArrayList<>();
-    private List<Directory> leechingCoRs = Collections.synchronizedList(Lists.newArrayList());
+    private List<Directory> leechingCoRs = Collections.synchronizedList(new ArrayList<>());
 
     private CountDownLatch firstCoRBlocker;
     private Future<String> firstCoRFutre;
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
index 85bff763fd..8c45e15513 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreTest.java
@@ -3272,7 +3272,7 @@ public class DocumentNodeStoreTest {
         builder.child("a").child("b").setProperty("p", 0L);
         merge(ns, builder);
 
-        final List<Throwable> exceptions = synchronizedList(Lists.newArrayList());
+        final List<Throwable> exceptions = synchronizedList(new ArrayList<>());
 
         Runnable task = new Runnable() {
 
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java
index f62800ce08..36e554d34c 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MongoDocumentStoreIT.java
@@ -254,7 +254,7 @@ public class MongoDocumentStoreIT extends AbstractMongoConnectionTest {
         docStore.create(Collection.NODES, inserts);
         List<NodeDocument> docs = docStore.query(Collection.NODES,
                 Utils.getKeyLowerLimit(Path.ROOT),  Utils.getKeyUpperLimit(Path.ROOT), null, 0,
-                20, newArrayList());
+                20, Collections.emptyList());
         docs.forEach(d -> assertEquals(4 , d.keySet().size()));
         assertEquals(10, docs.size());
     }
diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java
index cfef9f3b4d..7e7bb20008 100644
--- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java
+++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/ReadOnlyDocumentStoreWrapperTest.java
@@ -37,6 +37,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import static org.junit.Assert.assertFalse;
@@ -93,7 +94,7 @@ public class ReadOnlyDocumentStoreWrapperTest {
 
             uoeThrown = false;
             try {
-                readOnlyStore.remove(collection, Lists.<String>newArrayList());
+                readOnlyStore.remove(collection, Collections.emptyList());
             } catch (UnsupportedOperationException uoe) {
                 //catch uoe thrown by read only wrapper
                 uoeThrown = true;
@@ -129,7 +130,7 @@ public class ReadOnlyDocumentStoreWrapperTest {
             uoeThrown = false;
 
             try {
-                readOnlyStore.createOrUpdate(collection, Lists.<UpdateOp>newArrayList());
+                readOnlyStore.createOrUpdate(collection, Collections.emptyList());
             } catch (UnsupportedOperationException uoe) {
                 //catch uoe thrown by read only wrapper
                 uoeThrown = true;