From 9237b75f668463bc0f7e879525b19bb38135cfa7 Mon Sep 17 00:00:00 2001 From: Julian Reschke Date: Thu, 12 Dec 2024 06:51:40 +0100 Subject: [PATCH] OAK-11302: Remove usage of Guava annotations (#1896) --- .../jackrabbit/oak/plugins/version/VersionStorageEditor.java | 3 +-- .../oak/plugins/document/ClusterNodeInfoDocument.java | 3 +-- .../mongo/MongoDocumentStoreThrottlingMetricsUpdater.java | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionStorageEditor.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionStorageEditor.java index 7f2ae83ec3a..e0b914e534b 100644 --- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionStorageEditor.java +++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionStorageEditor.java @@ -16,7 +16,6 @@ */ package org.apache.jackrabbit.oak.plugins.version; -import org.apache.jackrabbit.guava.common.annotations.VisibleForTesting; import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.api.PropertyState; import org.apache.jackrabbit.oak.spi.commit.DefaultEditor; @@ -159,7 +158,7 @@ public void propertyDeleted(PropertyState before) //-------------------------< internal >------------------------------------- - @VisibleForTesting + // VisibleForTesting static boolean isVersionStorageNode(NodeState state) { String ntName = state.getName(JCR_PRIMARYTYPE); return (Objects.nonNull(ntName) && VERSION_STORE_NT_NAMES.contains(ntName)) diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfoDocument.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfoDocument.java index 014e42d43bb..fea2506618e 100644 --- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfoDocument.java +++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfoDocument.java @@ -26,7 +26,6 @@ import static org.apache.jackrabbit.oak.plugins.document.Revision.fromString; import static org.apache.jackrabbit.oak.plugins.document.Revision.getTimestampDifference; -import org.apache.jackrabbit.guava.common.annotations.VisibleForTesting; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -187,8 +186,8 @@ public boolean isInvisible() { * * @return {@link Predicate} to filter revisions older than lastWrittenRootRev */ + // VisibleForTesting @NotNull - @VisibleForTesting Predicate isOlderThanLastWrittenRootRevPredicate() { return r -> nonNull(getLastWrittenRootRev()) && getTimestampDifference(r, fromString(getLastWrittenRootRev())) < 0; } diff --git a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java index 6708b068acb..2e7aea81023 100644 --- a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java +++ b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java @@ -18,7 +18,6 @@ */ package org.apache.jackrabbit.oak.plugins.document.mongo; -import org.apache.jackrabbit.guava.common.annotations.VisibleForTesting; import org.apache.jackrabbit.guava.common.util.concurrent.AtomicDouble; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; @@ -95,8 +94,7 @@ public void scheduleUpdateMetrics() { }, 10, 30, SECONDS); } - // helper methods - @VisibleForTesting + // helper methods, visible for testing static double updateOplogWindow(final double maxSize, final double usedSize, final @NotNull Document first, final @NotNull Document last) { final BsonTimestamp startTime = first.get(TS_TIME, BsonTimestamp.class);