Skip to content

Commit

Permalink
OAK-11302: Remove usage of Guava annotations (#1896)
Browse files Browse the repository at this point in the history
  • Loading branch information
reschke authored Dec 12, 2024
1 parent 2dd5640 commit 9237b75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -187,8 +186,8 @@ public boolean isInvisible() {
*
* @return {@link Predicate} to filter revisions older than lastWrittenRootRev
*/
// VisibleForTesting
@NotNull
@VisibleForTesting
Predicate<Revision> isOlderThanLastWrittenRootRevPredicate() {
return r -> nonNull(getLastWrittenRootRev()) && getTimestampDifference(r, fromString(getLastWrittenRootRev())) < 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9237b75

Please sign in to comment.