diff --git a/oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java b/oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java index 1e15248b97a..5c93f4ea00d 100644 --- a/oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java +++ b/oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureBlobStoreBackend.java @@ -36,6 +36,7 @@ import java.util.Collection; import java.util.EnumSet; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -1240,7 +1241,7 @@ private class RecordsIterator extends AbstractIterator { ResultContinuation resultContinuation; boolean firstCall = true; final Function transformer; - final Queue items = Lists.newLinkedList(); + final Queue items = new LinkedList<>(); public RecordsIterator (Function transformer) { this.transformer = transformer; diff --git a/oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java b/oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java index 2f34b5ea5cf..cef9082d9a9 100644 --- a/oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java +++ b/oak-blob-cloud/src/main/java/org/apache/jackrabbit/oak/blob/cloud/s3/S3Backend.java @@ -29,6 +29,7 @@ import java.util.Collections; import java.util.Date; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; @@ -1055,7 +1056,7 @@ class RecordsIterator extends AbstractIterator { Function transformer; public RecordsIterator (Function transformer) { - queue = Lists.newLinkedList(); + queue = new LinkedList<>(); this.transformer = transformer; } diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java index 49ad9475095..34ea91e5801 100644 --- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java +++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/EventGenerator.java @@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.plugins.observation; import static org.apache.jackrabbit.guava.common.collect.Lists.newArrayList; -import static org.apache.jackrabbit.guava.common.collect.Lists.newLinkedList; import static org.apache.jackrabbit.oak.api.Type.NAMES; import static org.apache.jackrabbit.oak.api.Type.STRING; import static org.apache.jackrabbit.oak.plugins.tree.TreeConstants.OAK_CHILD_ORDER; @@ -73,7 +72,7 @@ public class EventGenerator { */ private static final int MAX_QUEUED_CONTINUATIONS = 1000; - private final LinkedList continuations = newLinkedList(); + private final LinkedList continuations = new LinkedList<>(); /** * Creates a new generator instance. Changes to process need to be added diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathHelper.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathHelper.java index 2c8601d3241..deb729f6ed1 100644 --- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathHelper.java +++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/filter/GlobbingPathHelper.java @@ -22,7 +22,7 @@ import java.util.List; -import org.apache.jackrabbit.guava.common.collect.Lists; +import org.apache.jackrabbit.oak.commons.collections.CollectionUtils; public class GlobbingPathHelper { @@ -52,7 +52,7 @@ public static String globPathAsRegex(String pathWithGlobs) { } else if (!pathWithGlobs.contains("*")) { return pathWithGlobs; } - List elements = Lists.newLinkedList(elements(pathWithGlobs)); + List elements = CollectionUtils.toLinkedList(elements(pathWithGlobs)); StringBuffer sb = new StringBuffer(); sb.append("\\Q"); if (pathWithGlobs.startsWith("/")) { diff --git a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java index 086e6cae7c3..d1d6aebb94e 100644 --- a/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java +++ b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/EventQueue.java @@ -18,7 +18,6 @@ */ package org.apache.jackrabbit.oak.jcr.observation; -import static org.apache.jackrabbit.guava.common.collect.Lists.newLinkedList; import java.util.LinkedList; import java.util.NoSuchElementException; @@ -46,7 +45,7 @@ class EventQueue implements EventIterator { private final EventGenerator generator; - private final LinkedList queue = newLinkedList(); + private final LinkedList queue = new LinkedList<>(); private long position = 0; diff --git a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/iotrace/BreadthFirstTrace.java b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/iotrace/BreadthFirstTrace.java index 696a8b57476..4fdb102f1a0 100644 --- a/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/iotrace/BreadthFirstTrace.java +++ b/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/iotrace/BreadthFirstTrace.java @@ -19,12 +19,12 @@ package org.apache.jackrabbit.oak.segment.tool.iotrace; import static org.apache.jackrabbit.guava.common.base.Preconditions.checkArgument; -import static org.apache.jackrabbit.guava.common.collect.Lists.newLinkedList; import static java.lang.String.valueOf; import static java.util.Collections.singleton; import static org.apache.jackrabbit.oak.commons.PathUtils.elements; import java.io.Writer; +import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.concurrent.atomic.AtomicInteger; @@ -79,7 +79,7 @@ public BreadthFirstTrace(int depth, @NotNull String path, @NotNull Consumer(singleton(getNode(node, path))), 0); } @NotNull @@ -93,7 +93,7 @@ private static NodeState getNode(@NotNull NodeState root, @NotNull String path) private void traverse(@NotNull Queue nodes, int depth) { if (!nodes.isEmpty()) { - Queue children = newLinkedList(); + Queue children = new LinkedList<>(); while (!nodes.isEmpty()) { NodeState head = nodes.poll(); assert head != null; diff --git a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeConflictHandler.java b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeConflictHandler.java index 9630b9e166b..d067010f207 100644 --- a/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeConflictHandler.java +++ b/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeConflictHandler.java @@ -20,7 +20,6 @@ package org.apache.jackrabbit.oak.spi.commit; import static java.util.Objects.requireNonNull; -import static org.apache.jackrabbit.guava.common.collect.Lists.newLinkedList; import static org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler.Resolution.IGNORED; import static org.apache.jackrabbit.oak.spi.state.ConflictType.ADD_EXISTING_NODE; import static org.apache.jackrabbit.oak.spi.state.ConflictType.ADD_EXISTING_PROPERTY; @@ -35,6 +34,7 @@ import java.util.LinkedList; import org.apache.jackrabbit.oak.api.PropertyState; +import org.apache.jackrabbit.oak.commons.collections.CollectionUtils; import org.apache.jackrabbit.oak.spi.state.NodeBuilder; import org.apache.jackrabbit.oak.spi.state.NodeState; import org.jetbrains.annotations.NotNull; @@ -57,7 +57,7 @@ public class CompositeConflictHandler implements ThreeWayConflictHandler { * @param handlers the backing handlers */ public CompositeConflictHandler(@NotNull Iterable handlers) { - this.handlers = newLinkedList(requireNonNull(handlers)); + this.handlers = (LinkedList) CollectionUtils.toLinkedList(requireNonNull(handlers)); } /** @@ -65,7 +65,7 @@ public CompositeConflictHandler(@NotNull Iterable handl * backing handler. Use {@link #addHandler(ThreeWayConflictHandler)} to add handlers. */ public CompositeConflictHandler() { - this.handlers = newLinkedList(); + this.handlers = new LinkedList<>(); } /**