Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
 Wed Jul 18 15:08:27 2018
@@ -63,9 +63,6 @@ import java.util.concurrent.atomic.Atomi
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import javax.jcr.PropertyType;
 import javax.management.NotCompliantMBeanException;
 
@@ -127,6 +124,8 @@ import org.apache.jackrabbit.oak.spi.whi
 import org.apache.jackrabbit.oak.stats.Clock;
 import org.apache.jackrabbit.oak.commons.PerfLogger;
 import org.apache.jackrabbit.oak.stats.StatisticsProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -246,7 +245,7 @@ public final class DocumentNodeStore
     /**
      * The cluster instance info.
      */
-    @Nonnull
+    @NotNull
     private final ClusterNodeInfo clusterNodeInfo;
 
     /**
@@ -314,13 +313,13 @@ public final class DocumentNodeStore
     /**
      * Background thread performing the clusterId lease renew.
      */
-    @Nonnull
+    @NotNull
     private Thread leaseUpdateThread;
 
     /**
      * Background thread performing the cluster update
      */
-    @Nonnull
+    @NotNull
     private Thread clusterUpdateThread;
 
     /**
@@ -730,7 +729,7 @@ public final class DocumentNodeStore
         Revision tombstone = commitQueue.createRevision();
         commitQueue.done(tombstone, new CommitQueue.Callback() {
             @Override
-            public void headOfQueue(@Nonnull Revision revision) {
+            public void headOfQueue(@NotNull Revision revision) {
                 setRoot(getHeadRevision().update(revision));
                 unsavedLastRevisions.put(ROOT_PATH, revision);
             }
@@ -803,12 +802,12 @@ public final class DocumentNodeStore
         return (readOnlyMode?"readOnly:true, ":"") + 
clusterNodeInfo.toString().replaceAll("[\r\n\t]", " ").trim();
     }
 
-    void setRoot(@Nonnull RevisionVector newHead) {
+    void setRoot(@NotNull RevisionVector newHead) {
         checkArgument(!newHead.isBranch());
         root = getRoot(newHead);
     }
 
-    @Nonnull
+    @NotNull
     public DocumentStore getDocumentStore() {
         return store;
     }
@@ -827,7 +826,7 @@ public final class DocumentNodeStore
      *               free to remove the commits associated with the branch.
      * @return a new commit.
      */
-    @Nonnull
+    @NotNull
     Commit newCommit(@Nullable RevisionVector base,
                      @Nullable DocumentNodeStoreBranch branch) {
         if (base == null) {
@@ -849,8 +848,8 @@ public final class DocumentNodeStore
      * @param numBranchCommits the number of branch commits to merge.
      * @return a new merge commit.
      */
-    @Nonnull
-    private MergeCommit newMergeCommit(@Nonnull RevisionVector base, int 
numBranchCommits) {
+    @NotNull
+    private MergeCommit newMergeCommit(@NotNull RevisionVector base, int 
numBranchCommits) {
         checkNotNull(base);
         backgroundOperationLock.readLock().lock();
         boolean success = false;
@@ -867,14 +866,14 @@ public final class DocumentNodeStore
         return c;
     }
 
-    RevisionVector done(final @Nonnull Commit c, boolean isBranch, final 
@Nonnull CommitInfo info) {
+    RevisionVector done(final @NotNull Commit c, boolean isBranch, final 
@NotNull CommitInfo info) {
         if (commitQueue.contains(c.getRevision())) {
             try {
                 inDoubtTrunkCommits.remove(c.getRevision());
                 final RevisionVector[] newHead = new RevisionVector[1];
                 commitQueue.done(c.getRevision(), new CommitQueue.Callback() {
                     @Override
-                    public void headOfQueue(@Nonnull Revision revision) {
+                    public void headOfQueue(@NotNull Revision revision) {
                         // remember before revision
                         RevisionVector before = getHeadRevision();
 
@@ -1013,7 +1012,7 @@ public final class DocumentNodeStore
         this.journalPushThreshold = journalPushThreshold;
     }
 
-    @Nonnull
+    @NotNull
     public ClusterNodeInfo getClusterInfo() {
         return clusterNodeInfo;
     }
@@ -1026,7 +1025,7 @@ public final class DocumentNodeStore
         return nodeChildrenCacheStats;
     }
 
-    @Nonnull
+    @NotNull
     public Iterable<CacheStats> getDiffCacheStats() {
         return diffCache.getStats();
     }
@@ -1078,10 +1077,10 @@ public final class DocumentNodeStore
         splitCandidates.put(id, id);
     }
 
-    @CheckForNull
-    AbstractDocumentNodeState getSecondaryNodeState(@Nonnull final String path,
-                              @Nonnull final RevisionVector rootRevision,
-                              @Nonnull final RevisionVector rev) {
+    @Nullable
+    AbstractDocumentNodeState getSecondaryNodeState(@NotNull final String path,
+                              @NotNull final RevisionVector rootRevision,
+                              @NotNull final RevisionVector rev) {
         //Check secondary cache first
         return nodeStateCache.getDocumentNodeState(path, rootRevision, rev);
     }
@@ -1099,9 +1098,9 @@ public final class DocumentNodeStore
      * @return the node or <code>null</code> if the node does not exist at the
      *          given revision.
      */
-    @CheckForNull
-    public DocumentNodeState getNode(@Nonnull final String path,
-                              @Nonnull final RevisionVector rev) {
+    @Nullable
+    public DocumentNodeState getNode(@NotNull final String path,
+                              @NotNull final RevisionVector rev) {
         checkNotNull(rev);
         checkNotNull(path);
         final long start = PERFLOG.start();
@@ -1132,8 +1131,8 @@ public final class DocumentNodeStore
         }
     }
 
-    @Nonnull
-    DocumentNodeState.Children getChildren(@Nonnull final 
AbstractDocumentNodeState parent,
+    @NotNull
+    DocumentNodeState.Children getChildren(@NotNull final 
AbstractDocumentNodeState parent,
                               @Nullable final String name,
                               final int limit)
             throws DocumentStoreException {
@@ -1244,8 +1243,8 @@ public final class DocumentNodeStore
      * @param limit the maximum number of child documents to return.
      * @return the child documents.
      */
-    @Nonnull
-    private Iterable<NodeDocument> readChildDocs(@Nonnull final String path,
+    @NotNull
+    private Iterable<NodeDocument> readChildDocs(@NotNull final String path,
                                                  @Nullable String name,
                                                  final int limit) {
         final String to = Utils.getKeyUpperLimit(checkNotNull(path));
@@ -1269,8 +1268,8 @@ public final class DocumentNodeStore
      * @param limit the maximum number of child nodes to return.
      * @return the child nodes.
      */
-    @Nonnull
-    Iterable<DocumentNodeState> getChildNodes(@Nonnull final DocumentNodeState 
parent,
+    @NotNull
+    Iterable<DocumentNodeState> getChildNodes(@NotNull final DocumentNodeState 
parent,
                     @Nullable final String name,
                     final int limit) {
         // Preemptive check. If we know there are no children then
@@ -1326,7 +1325,7 @@ public final class DocumentNodeStore
         });
     }
 
-    @CheckForNull
+    @Nullable
     DocumentNodeState readNode(String path, RevisionVector readRevision) {
         final long start = PERFLOG.start();
         String id = Utils.getIdFromPath(path);
@@ -1471,7 +1470,7 @@ public final class DocumentNodeStore
      *
      * @param revisions the revisions of the merged branch commits.
      */
-    void revisionsMerged(@Nonnull Iterable<Revision> revisions) {
+    void revisionsMerged(@NotNull Iterable<Revision> revisions) {
         changes.branchCommit(revisions);
     }
 
@@ -1484,7 +1483,7 @@ public final class DocumentNodeStore
      *          if the update failed because of a collision.
      * @throws DocumentStoreException if the update fails with an error.
      */
-    @CheckForNull
+    @Nullable
     NodeDocument updateCommitRoot(UpdateOp commit, Revision commitRev)
             throws DocumentStoreException {
         // use batch commit when there are only revision and modified updates
@@ -1576,8 +1575,8 @@ public final class DocumentNodeStore
      * @param revision a revision.
      * @return the root node state at the given revision.
      */
-    @Nonnull
-    DocumentNodeState getRoot(@Nonnull RevisionVector revision) {
+    @NotNull
+    DocumentNodeState getRoot(@NotNull RevisionVector revision) {
         DocumentNodeState root = getNode("/", revision);
         if (root == null) {
             throw new IllegalStateException(
@@ -1586,14 +1585,14 @@ public final class DocumentNodeStore
         return root;
     }
 
-    @Nonnull
+    @NotNull
     DocumentNodeStoreBranch createBranch(DocumentNodeState base) {
         return new DocumentNodeStoreBranch(this, base, mergeLock);
     }
 
-    @Nonnull
-    RevisionVector rebase(@Nonnull RevisionVector branchHead,
-                          @Nonnull RevisionVector base) {
+    @NotNull
+    RevisionVector rebase(@NotNull RevisionVector branchHead,
+                          @NotNull RevisionVector base) {
         checkNotNull(branchHead);
         checkNotNull(base);
         if (disableBranches) {
@@ -1615,9 +1614,9 @@ public final class DocumentNodeStore
         return base.update(head);
     }
 
-    @Nonnull
-    RevisionVector reset(@Nonnull RevisionVector branchHead,
-                         @Nonnull RevisionVector ancestor) {
+    @NotNull
+    RevisionVector reset(@NotNull RevisionVector branchHead,
+                         @NotNull RevisionVector ancestor) {
         checkNotNull(branchHead);
         checkNotNull(ancestor);
         Branch b = getBranches().getBranch(branchHead);
@@ -1670,9 +1669,9 @@ public final class DocumentNodeStore
         return ancestor;
     }
 
-    @Nonnull
-    RevisionVector merge(@Nonnull RevisionVector branchHead,
-                         @Nonnull CommitInfo info)
+    @NotNull
+    RevisionVector merge(@NotNull RevisionVector branchHead,
+                         @NotNull CommitInfo info)
             throws ConflictException, CommitFailedException {
         Branch b = getBranches().getBranch(branchHead);
         RevisionVector base = branchHead;
@@ -1735,9 +1734,9 @@ public final class DocumentNodeStore
      *         (see the {@link NodeStateDiff} contract for more details)
      */
     @Override
-    public boolean compare(@Nonnull final AbstractDocumentNodeState node,
-                           @Nonnull final AbstractDocumentNodeState base,
-                           @Nonnull NodeStateDiff diff) {
+    public boolean compare(@NotNull final AbstractDocumentNodeState node,
+                           @NotNull final AbstractDocumentNodeState base,
+                           @NotNull NodeStateDiff diff) {
         if (!AbstractNodeState.comparePropertiesAgainstBaseState(node, base, 
diff)) {
             return false;
         }
@@ -1761,7 +1760,7 @@ public final class DocumentNodeStore
      * @param isBranchCommit whether this is a branch commit.
      * @return a _lastRev tracker for the given commit revision.
      */
-    LastRevTracker createTracker(final @Nonnull Revision r,
+    LastRevTracker createTracker(final @NotNull Revision r,
                                  final boolean isBranchCommit) {
         if (isBranchCommit && !disableBranches) {
             Revision branchRev = r.asBranchRevision();
@@ -1785,7 +1784,7 @@ public final class DocumentNodeStore
      *
      * @param conflictRevisions the revision to become visible.
      */
-    void suspendUntilAll(@Nonnull Set<Revision> conflictRevisions) {
+    void suspendUntilAll(@NotNull Set<Revision> conflictRevisions) {
         // do not suspend if revision is from another cluster node
         // and background read is disabled
         if (getAsyncDelay() == 0) {
@@ -1810,34 +1809,34 @@ public final class DocumentNodeStore
 
     //-------------------------< NodeStore 
>------------------------------------
 
-    @Nonnull
+    @NotNull
     @Override
     public DocumentNodeState getRoot() {
         return root;
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public NodeState merge(@Nonnull NodeBuilder builder,
-                           @Nonnull CommitHook commitHook,
-                           @Nonnull CommitInfo info)
+    public NodeState merge(@NotNull NodeBuilder builder,
+                           @NotNull CommitHook commitHook,
+                           @NotNull CommitInfo info)
             throws CommitFailedException {
         return asDocumentRootBuilder(builder).merge(commitHook, info);
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public NodeState rebase(@Nonnull NodeBuilder builder) {
+    public NodeState rebase(@NotNull NodeBuilder builder) {
         return asDocumentRootBuilder(builder).rebase();
     }
 
     @Override
-    public NodeState reset(@Nonnull NodeBuilder builder) {
+    public NodeState reset(@NotNull NodeBuilder builder) {
         return asDocumentRootBuilder(builder).reset();
     }
 
     @Override
-    @Nonnull
+    @NotNull
     public BlobStoreBlob createBlob(InputStream inputStream) throws 
IOException {
         return new BlobStoreBlob(blobStore, blobStore.writeBlob(inputStream));
     }
@@ -1850,7 +1849,7 @@ public final class DocumentNodeStore
      * @return the blob.
      */
     @Override
-    public Blob getBlob(@Nonnull String reference) {
+    public Blob getBlob(@NotNull String reference) {
         String blobId = blobStore.getBlobId(reference);
         if(blobId != null){
             return new BlobStoreBlob(blobStore, blobId);
@@ -1869,22 +1868,22 @@ public final class DocumentNodeStore
         return new BlobStoreBlob(blobStore, blobId);
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public String checkpoint(long lifetime, @Nonnull Map<String, String> 
properties) {
+    public String checkpoint(long lifetime, @NotNull Map<String, String> 
properties) {
         return checkpoints.create(lifetime, properties).toString();
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public String checkpoint(long lifetime) {
         Map<String, String> empty = Collections.emptyMap();
         return checkpoint(lifetime, empty);
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public Map<String, String> checkpointInfo(@Nonnull String checkpoint) {
+    public Map<String, String> checkpointInfo(@NotNull String checkpoint) {
         Revision r = Revision.fromString(checkpoint);
         Checkpoints.Info info = checkpoints.getCheckpoints().get(r);
         if (info == null) {
@@ -1895,7 +1894,7 @@ public final class DocumentNodeStore
         }
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public Iterable<String> checkpoints() {
         final long now = clock.getTime();
@@ -1913,9 +1912,9 @@ public final class DocumentNodeStore
         });
     }
 
-    @CheckForNull
+    @Nullable
     @Override
-    public NodeState retrieve(@Nonnull String checkpoint) {
+    public NodeState retrieve(@NotNull String checkpoint) {
         RevisionVector rv = getCheckpoints().retrieve(checkpoint);
         if (rv == null) {
             return null;
@@ -1926,7 +1925,7 @@ public final class DocumentNodeStore
     }
 
     @Override
-    public boolean release(@Nonnull String checkpoint) {
+    public boolean release(@NotNull String checkpoint) {
         checkpoints.release(checkpoint);
         return true;
     }
@@ -1949,13 +1948,13 @@ public final class DocumentNodeStore
     }
 
     @Override
-    @Nonnull
+    @NotNull
     public RevisionVector getHeadRevision() {
         return root.getRootRevision();
     }
 
     @Override
-    @Nonnull
+    @NotNull
     public Revision newRevision() {
         if (simpleRevisionCounter != null) {
             return new Revision(simpleRevisionCounter.getAndIncrement(), 0, 
clusterId);
@@ -1975,14 +1974,14 @@ public final class DocumentNodeStore
     }
 
     @Override
-    @Nonnull
+    @NotNull
     public Clock getClock() {
         return clock;
     }
 
     @Override
-    public String getCommitValue(@Nonnull Revision changeRevision,
-                                 @Nonnull NodeDocument doc) {
+    public String getCommitValue(@NotNull Revision changeRevision,
+                                 @NotNull NodeDocument doc) {
         return commitValueResolver.resolve(changeRevision, doc);
     }
 
@@ -2166,7 +2165,7 @@ public final class DocumentNodeStore
      *          started. The revision is derived from the start time of the
      *          cluster node.
      */
-    @Nonnull
+    @NotNull
     private RevisionVector getMinExternalRevisions() {
         return new RevisionVector(transform(filter(clusterNodes.values(),
                 new Predicate<ClusterNodeInfoDocument>() {
@@ -2189,7 +2188,7 @@ public final class DocumentNodeStore
     private BackgroundReadStats backgroundRead() {
         return new ExternalChange(this) {
             @Override
-            void invalidateCache(@Nonnull Iterable<String> paths) {
+            void invalidateCache(@NotNull Iterable<String> paths) {
                 stats.cacheStats = store.invalidateCache(pathToId(paths));
             }
 
@@ -2199,8 +2198,8 @@ public final class DocumentNodeStore
             }
 
             @Override
-            void updateHead(@Nonnull Set<Revision> externalChanges,
-                            @Nonnull RevisionVector sweepRevs,
+            void updateHead(@NotNull Set<Revision> externalChanges,
+                            @NotNull RevisionVector sweepRevs,
                             @Nullable Iterable<String> changedPaths) {
                 long time = clock.getTime();
                 // make sure no local commit is in progress
@@ -2244,7 +2243,7 @@ public final class DocumentNodeStore
         }.process();
     }
 
-    private static CommitInfo newCommitInfo(@Nonnull ChangeSet changeSet, 
JournalPropertyHandler journalPropertyHandler) {
+    private static CommitInfo newCommitInfo(@NotNull ChangeSet changeSet, 
JournalPropertyHandler journalPropertyHandler) {
         CommitContext commitContext = new SimpleCommitContext();
         commitContext.set(COMMIT_CONTEXT_OBSERVATION_CHANGESET, changeSet);
         journalPropertyHandler.addTo(commitContext);
@@ -2336,12 +2335,12 @@ public final class DocumentNodeStore
         }
     }
 
-    @Nonnull
+    @NotNull
     Set<String> getSplitCandidates() {
         return Collections.unmodifiableSet(splitCandidates.keySet());
     }
 
-    @Nonnull
+    @NotNull
     RevisionVector getSweepRevisions() {
         return sweepRevisions;
     }
@@ -2446,7 +2445,7 @@ public final class DocumentNodeStore
                         try {
                             commitQueue.done(r, new CommitQueue.Callback() {
                                 @Override
-                                public void headOfQueue(@Nonnull Revision 
revision) {
+                                public void headOfQueue(@NotNull Revision 
revision) {
                                     writeUpdates(updates, revision);
                                 }
                             });
@@ -2610,8 +2609,8 @@ public final class DocumentNodeStore
         setRoot(headRevision);
     }
 
-    @Nonnull
-    private Commit newTrunkCommit(@Nonnull RevisionVector base) {
+    @NotNull
+    private Commit newTrunkCommit(@NotNull RevisionVector base) {
         checkArgument(!checkNotNull(base).isBranch(),
                 "base must not be a branch revision: " + base);
 
@@ -2631,8 +2630,8 @@ public final class DocumentNodeStore
         return c;
     }
 
-    @Nonnull
-    private Commit newBranchCommit(@Nonnull RevisionVector base,
+    @NotNull
+    private Commit newBranchCommit(@NotNull RevisionVector base,
                                    @Nullable DocumentNodeStoreBranch branch) {
         checkArgument(checkNotNull(base).isBranch(),
                 "base must be a branch revision: " + base);
@@ -2920,8 +2919,8 @@ public final class DocumentNodeStore
         }
     }
 
-    private static PathRev childNodeCacheKey(@Nonnull String path,
-                                             @Nonnull RevisionVector 
readRevision,
+    private static PathRev childNodeCacheKey(@NotNull String path,
+                                             @NotNull RevisionVector 
readRevision,
                                              @Nullable String name) {
         String p = (name == null ? "" : name) + path;
         return new PathRev(p, readRevision);
@@ -2966,7 +2965,7 @@ public final class DocumentNodeStore
      * @param statisticsProvider
      * @return garbage collector of the BlobStore supports GC otherwise null
      */
-    @CheckForNull
+    @Nullable
     public MarkSweepGarbageCollector createBlobGarbageCollector(long 
blobGcMaxAgeInSecs, String repositoryId,
         Whiteboard whiteboard, StatisticsProvider statisticsProvider) {
         MarkSweepGarbageCollector blobGC = null;
@@ -3040,7 +3039,7 @@ public final class DocumentNodeStore
             this(nodeStore, isDisposed, null);
         }
 
-        protected abstract void execute(@Nonnull DocumentNodeStore nodeStore);
+        protected abstract void execute(@NotNull DocumentNodeStore nodeStore);
 
         @Override
         public void run() {
@@ -3086,7 +3085,7 @@ public final class DocumentNodeStore
         }
 
         @Override
-        protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+        protected void execute(@NotNull DocumentNodeStore nodeStore) {
             nodeStore.runBackgroundUpdateOperations();
         }
     }
@@ -3102,7 +3101,7 @@ public final class DocumentNodeStore
         }
 
         @Override
-        protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+        protected void execute(@NotNull DocumentNodeStore nodeStore) {
             nodeStore.runBackgroundReadOperations();
         }
     }
@@ -3118,7 +3117,7 @@ public final class DocumentNodeStore
         }
 
         @Override
-        protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+        protected void execute(@NotNull DocumentNodeStore nodeStore) {
             nodeStore.backgroundSweep();
         }
 
@@ -3148,7 +3147,7 @@ public final class DocumentNodeStore
         }
 
         @Override
-        protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+        protected void execute(@NotNull DocumentNodeStore nodeStore) {
             // OAK-4859 : keep track of invocation time of renewClusterIdLease
             // and warn if time since last call is longer than 5sec
             Clock clock = nodeStore.getClock();
@@ -3179,7 +3178,7 @@ public final class DocumentNodeStore
         }
 
         @Override
-        protected void execute(@Nonnull DocumentNodeStore nodeStore) {
+        protected void execute(@NotNull DocumentNodeStore nodeStore) {
             if (nodeStore.updateClusterState()) {
                 nodeStore.signalClusterStateChange();
             }
@@ -3214,17 +3213,17 @@ public final class DocumentNodeStore
         return checkpoints;
     }
 
-    @Nonnull
+    @NotNull
     public VersionGarbageCollector getVersionGarbageCollector() {
         return versionGarbageCollector;
     }
 
-    @Nonnull
+    @NotNull
     public JournalGarbageCollector getJournalGarbageCollector() {
         return journalGarbageCollector;
     }
     
-    @Nonnull
+    @NotNull
     public LastRevRecoveryAgent getLastRevRecoveryAgent() {
         return lastRevRecoveryAgent;
     }
@@ -3255,7 +3254,7 @@ public final class DocumentNodeStore
     }
     
     @Override
-    public boolean isVisible(@Nonnull String visibilityToken, long 
maxWaitMillis) throws InterruptedException {
+    public boolean isVisible(@NotNull String visibilityToken, long 
maxWaitMillis) throws InterruptedException {
         if (Strings.isNullOrEmpty(visibilityToken)) {
             // we've asked for @Nonnull..
             // hence throwing an exception

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBranch.java
 Wed Jul 18 15:08:27 2018
@@ -30,9 +30,6 @@ import java.util.Set;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
@@ -47,6 +44,8 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 import org.apache.jackrabbit.oak.commons.PerfLogger;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,13 +94,13 @@ class DocumentNodeStoreBranch implements
         this.updateLimit = store.getUpdateLimit();
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public NodeState getBase() {
         return branchState.getBase();
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public NodeState getHead() {
         return branchState.getHead();
@@ -112,9 +111,9 @@ class DocumentNodeStoreBranch implements
         branchState.setRoot(checkNotNull(newRoot));
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public NodeState merge(@Nonnull CommitHook hook, @Nonnull CommitInfo info)
+    public NodeState merge(@NotNull CommitHook hook, @NotNull CommitInfo info)
             throws CommitFailedException {
         try {
             return merge0(hook, info, false);
@@ -143,7 +142,7 @@ class DocumentNodeStoreBranch implements
     /**
      * For test purposes only!
      */
-    @Nonnull
+    @NotNull
     ReadWriteLock getMergeLock() {
         return mergeLock;
     }
@@ -157,9 +156,9 @@ class DocumentNodeStoreBranch implements
         branchState.persist();
     }
 
-    @Nonnull
-    private NodeState merge0(@Nonnull CommitHook hook,
-                             @Nonnull CommitInfo info,
+    @NotNull
+    private NodeState merge0(@NotNull CommitHook hook,
+                             @NotNull CommitInfo info,
                              boolean exclusive)
             throws CommitFailedException {
         CommitFailedException ex = null;
@@ -228,7 +227,7 @@ class DocumentNodeStoreBranch implements
      * @throws CommitFailedException if the current thread is interrupted while
      *                               acquiring the lock
      */
-    @CheckForNull
+    @Nullable
     private Lock acquireMergeLock(boolean exclusive)
             throws CommitFailedException {
         final long start = perfLogger.start();
@@ -273,9 +272,9 @@ class DocumentNodeStoreBranch implements
      * @throws DocumentStoreException if the persist operation failed because
      *          of an exception in the underlying {@link DocumentStore}.
      */
-    private DocumentNodeState persist(final @Nonnull NodeState toPersist,
-                                      final @Nonnull DocumentNodeState base,
-                                      final @Nonnull CommitInfo info)
+    private DocumentNodeState persist(final @NotNull NodeState toPersist,
+                                      final @NotNull DocumentNodeState base,
+                                      final @NotNull CommitInfo info)
             throws ConflictException, DocumentStoreException {
         return persist(new Changes() {
             @Override
@@ -299,9 +298,9 @@ class DocumentNodeStoreBranch implements
      * @throws DocumentStoreException if the persist operation failed because
      *          of an exception in the underlying {@link DocumentStore}.
      */
-    private DocumentNodeState persist(@Nonnull Changes op,
-                                      @Nonnull DocumentNodeState base,
-                                      @Nonnull CommitInfo info)
+    private DocumentNodeState persist(@NotNull Changes op,
+                                      @NotNull DocumentNodeState base,
+                                      @NotNull CommitInfo info)
             throws ConflictException, DocumentStoreException {
         boolean success = false;
         Commit c = store.newCommit(base.getRootRevision(), this);
@@ -366,7 +365,7 @@ class DocumentNodeStoreBranch implements
             return base;
         }
 
-        @Nonnull
+        @NotNull
         abstract NodeState getHead();
 
         abstract void setRoot(NodeState root);
@@ -393,9 +392,9 @@ class DocumentNodeStoreBranch implements
          *          use the appropriate type in {@code CommitFailedException} 
to
          *          indicate the cause of the exception.
          */
-        @Nonnull
-        abstract NodeState merge(@Nonnull CommitHook hook,
-                                 @Nonnull CommitInfo info,
+        @NotNull
+        abstract NodeState merge(@NotNull CommitHook hook,
+                                 @NotNull CommitInfo info,
                                  boolean exclusive)
                 throws CommitFailedException;
     }
@@ -421,7 +420,7 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
+        @NotNull
         NodeState getHead() {
             return base;
         }
@@ -439,9 +438,9 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
-        NodeState merge(@Nonnull CommitHook hook,
-                        @Nonnull CommitInfo info,
+        @NotNull
+        NodeState merge(@NotNull CommitHook hook,
+                        @NotNull CommitInfo info,
                         boolean exclusive) {
             branchState = new Merged(base);
             return base;
@@ -477,7 +476,7 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
+        @NotNull
         NodeState getHead() {
             return head;
         }
@@ -511,9 +510,9 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
-        NodeState merge(@Nonnull CommitHook hook,
-                        @Nonnull CommitInfo info,
+        @NotNull
+        NodeState merge(@NotNull CommitHook hook,
+                        @NotNull CommitInfo info,
                         boolean exclusive)
                 throws CommitFailedException {
             checkNotNull(hook);
@@ -609,7 +608,7 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
+        @NotNull
         DocumentNodeState getHead() {
             return head;
         }
@@ -631,9 +630,9 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
-        NodeState merge(@Nonnull final CommitHook hook,
-                        @Nonnull final CommitInfo info,
+        @NotNull
+        NodeState merge(@NotNull final CommitHook hook,
+                        @NotNull final CommitInfo info,
                         boolean exclusive)
                 throws CommitFailedException {
             boolean success = false;
@@ -736,7 +735,7 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
+        @NotNull
         NodeState getHead() {
             throw new IllegalStateException("Branch has already been merged");
         }
@@ -752,9 +751,9 @@ class DocumentNodeStoreBranch implements
         }
 
         @Override
-        @Nonnull
-        NodeState merge(@Nonnull CommitHook hook,
-                        @Nonnull CommitInfo info,
+        @NotNull
+        NodeState merge(@NotNull CommitHook hook,
+                        @NotNull CommitInfo info,
                         boolean exclusive) {
             throw new IllegalStateException("Branch has already been merged");
         }
@@ -778,7 +777,7 @@ class DocumentNodeStoreBranch implements
             this.ex = e;
         }
 
-        @Nonnull
+        @NotNull
         @Override
         NodeState getHead() {
             throw new IllegalStateException("Branch with failed reset", ex);
@@ -800,10 +799,10 @@ class DocumentNodeStoreBranch implements
          *
          * @throws CommitFailedException the exception of the failed reset.
          */
-        @Nonnull
+        @NotNull
         @Override
-        NodeState merge(@Nonnull CommitHook hook,
-                        @Nonnull CommitInfo info,
+        NodeState merge(@NotNull CommitHook hook,
+                        @NotNull CommitInfo info,
                         boolean exclusive)
                 throws CommitFailedException {
             throw ex;

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
 Wed Jul 18 15:08:27 2018
@@ -22,9 +22,6 @@ import java.util.Set;
 import java.util.concurrent.CopyOnWriteArraySet;
 import java.util.concurrent.Executor;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
 import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 import com.google.common.base.Supplier;
@@ -60,6 +57,8 @@ import org.apache.jackrabbit.oak.spi.gc.
 import org.apache.jackrabbit.oak.spi.gc.LoggingGCMonitor;
 import org.apache.jackrabbit.oak.stats.Clock;
 import org.apache.jackrabbit.oak.stats.StatisticsProvider;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -479,17 +478,17 @@ public class DocumentNodeStoreBuilder<T
         return thisBuilder();
     }
 
-    @Nonnull
+    @NotNull
     public Map<CacheType, PersistentCacheStats> getPersistenceCacheStats() {
         return persistentCacheStats;
     }
 
-    @CheckForNull
+    @Nullable
     public BlobStoreStats getBlobStoreStats() {
         return blobStoreStats;
     }
 
-    @CheckForNull
+    @Nullable
     public CacheStats getBlobStoreCacheStats() {
         return blobStoreCacheStats;
     }
@@ -567,7 +566,7 @@ public class DocumentNodeStoreBuilder<T
         return maxRevisionAgeMillis;
     }
 
-    public T setGCMonitor(@Nonnull GCMonitor gcMonitor) {
+    public T setGCMonitor(@NotNull GCMonitor gcMonitor) {
         this.gcMonitor = checkNotNull(gcMonitor);
         return thisBuilder();
     }

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
 Wed Jul 18 15:08:27 2018
@@ -46,7 +46,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
-import javax.annotation.Nonnull;
 import javax.sql.DataSource;
 
 import com.google.common.base.Predicate;
@@ -105,6 +104,7 @@ import org.apache.jackrabbit.oak.spi.whi
 import org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardExecutor;
 import org.apache.jackrabbit.oak.stats.StatisticsProvider;
 import org.apache.jackrabbit.oak.spi.descriptors.GenericDescriptors;
+import org.jetbrains.annotations.NotNull;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
@@ -858,11 +858,11 @@ public class DocumentNodeStoreService {
         return result;
     }
 
-    private void addRegistration(@Nonnull Registration reg) {
+    private void addRegistration(@NotNull Registration reg) {
         closer.register(asCloseable(reg));
     }
 
-    private static Closeable asCloseable(@Nonnull final Registration reg) {
+    private static Closeable asCloseable(@NotNull final Registration reg) {
         checkNotNull(reg);
         return new Closeable() {
             @Override
@@ -872,7 +872,7 @@ public class DocumentNodeStoreService {
         };
     }
 
-    private static Closeable asCloseable(@Nonnull final AbstractServiceTracker 
t) {
+    private static Closeable asCloseable(@NotNull final AbstractServiceTracker 
t) {
         checkNotNull(t);
         return new Closeable() {
             @Override

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
 Wed Jul 18 15:08:27 2018
@@ -21,7 +21,6 @@ import static org.apache.jackrabbit.oak.
 
 import java.util.List;
 
-import javax.annotation.Nonnull;
 import javax.jcr.PropertyType;
 
 import com.google.common.collect.Lists;
@@ -38,6 +37,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
 import org.apache.jackrabbit.oak.plugins.memory.StringPropertyState;
 import org.apache.jackrabbit.oak.plugins.value.Conversions;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * PropertyState implementation with lazy parsing of the JSOP encoded value.
@@ -58,7 +58,7 @@ final class DocumentPropertyState implem
         this.value = value;
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public String getName() {
         return name;
@@ -74,13 +74,13 @@ final class DocumentPropertyState implem
         return parsed().getType();
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public <T> T getValue(Type<T> type) {
         return parsed().getValue(type);
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public <T> T getValue(Type<T> type, int index) {
         return parsed().getValue(type, index);
@@ -114,7 +114,7 @@ final class DocumentPropertyState implem
      *
      * @return the raw un-parsed value.
      */
-    @Nonnull
+    @NotNull
     String getValue() {
         return value;
     }

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentRootBuilder.java
 Wed Jul 18 15:08:27 2018
@@ -22,14 +22,13 @@ import static org.apache.jackrabbit.oak.
 import java.io.IOException;
 import java.io.InputStream;
 
-import javax.annotation.Nonnull;
-
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,7 +51,7 @@ class DocumentRootBuilder extends Abstra
      * This differs from the base state of super since the latter one reflects
      * the base created by the last purge.
      */
-    @Nonnull
+    @NotNull
     private NodeState base;
 
     /**
@@ -71,9 +70,9 @@ class DocumentRootBuilder extends Abstra
      */
     private int updates;
 
-    DocumentRootBuilder(@Nonnull DocumentNodeState base,
-                        @Nonnull DocumentNodeStore store,
-                        @Nonnull DocumentNodeStoreBranch branch) {
+    DocumentRootBuilder(@NotNull DocumentNodeState base,
+                        @NotNull DocumentNodeStore store,
+                        @NotNull DocumentNodeStoreBranch branch) {
         super(checkNotNull(base));
         this.store = checkNotNull(store);
         this.base = base;
@@ -84,13 +83,13 @@ class DocumentRootBuilder extends Abstra
     //--------------------------------------------------< MemoryNodeBuilder 
>---
 
 
-    @Override @Nonnull
+    @Override @NotNull
     public NodeState getBaseState() {
         return base;
     }
 
     @Override
-    public void reset(@Nonnull NodeState newBase) {
+    public void reset(@NotNull NodeState newBase) {
         base = checkNotNull(newBase);
         super.reset(newBase);
     }
@@ -107,7 +106,7 @@ class DocumentRootBuilder extends Abstra
         }
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public NodeState getNodeState() {
         if (updates > 0) {

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java
 Wed Jul 18 15:08:27 2018
@@ -19,12 +19,11 @@ package org.apache.jackrabbit.oak.plugin
 import java.util.List;
 import java.util.Map;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
 import org.apache.jackrabbit.oak.cache.CacheStats;
 import org.apache.jackrabbit.oak.plugins.document.UpdateOp.Condition;
 import org.apache.jackrabbit.oak.plugins.document.cache.CacheInvalidationStats;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * The interface for the backend storage for documents.
@@ -56,7 +55,7 @@ public interface DocumentStore {
      * @throws DocumentStoreException if the operation failed. E.g. because of
      *          an I/O error.
      */
-    @CheckForNull
+    @Nullable
     <T extends Document> T find(Collection<T> collection, String key)
             throws DocumentStoreException;
 
@@ -78,7 +77,7 @@ public interface DocumentStore {
      * @throws DocumentStoreException if the operation failed. E.g. because of
      *          an I/O error.
      */
-    @CheckForNull
+    @Nullable
     <T extends Document> T find(Collection<T> collection, String key, int 
maxCacheAge)
             throws DocumentStoreException;
 
@@ -97,7 +96,7 @@ public interface DocumentStore {
      * @throws DocumentStoreException if the operation failed. E.g. because of
      *          an I/O error.
      */
-    @Nonnull
+    @NotNull
     <T extends Document> List<T> query(Collection<T> collection,
                                        String fromKey,
                                        String toKey,
@@ -125,7 +124,7 @@ public interface DocumentStore {
      * @throws DocumentStoreException if the operation failed. E.g. because of
      *          an I/O error.
      */
-    @Nonnull
+    @NotNull
     <T extends Document> List<T> query(Collection<T> collection,
                                        String fromKey,
                                        String toKey,
@@ -276,7 +275,7 @@ public interface DocumentStore {
      * @throws DocumentStoreException if the operation failed. E.g. because of
      *          an I/O error.
      */
-    @CheckForNull
+    @Nullable
     <T extends Document> T createOrUpdate(Collection<T> collection,
                                           UpdateOp update)
             throws IllegalArgumentException, DocumentStoreException;
@@ -329,7 +328,7 @@ public interface DocumentStore {
      * @throws DocumentStoreException if the operation failed. E.g. because of
      *          an I/O error.
      */
-    @CheckForNull
+    @Nullable
     <T extends Document> T findAndUpdate(Collection<T> collection,
                                          UpdateOp update)
             throws DocumentStoreException;
@@ -355,7 +354,7 @@ public interface DocumentStore {
      * @return cache invalidation statistics or {@code null} if none are
      *          available.
      */
-    @CheckForNull
+    @Nullable
     CacheInvalidationStats invalidateCache();
 
     /**
@@ -369,7 +368,7 @@ public interface DocumentStore {
      * @return cache invalidation statistics or {@code null} if none are
      *          available.
      */
-    @CheckForNull
+    @Nullable
     CacheInvalidationStats invalidateCache(Iterable<String> keys);
 
     /**
@@ -400,7 +399,7 @@ public interface DocumentStore {
      * @param key the key
      * @return cached document if present. Otherwise {@code null}.
      */
-    @CheckForNull
+    @Nullable
     <T extends Document> T getIfCached(Collection<T> collection, String key);
 
     /**
@@ -413,7 +412,7 @@ public interface DocumentStore {
     /**
      * @return status information about the cache
      */
-    @CheckForNull
+    @Nullable
     Iterable<CacheStats> getCacheStats();
 
     /**
@@ -431,7 +430,7 @@ public interface DocumentStore {
      *
      * @return statistics about this document store.
      */
-    @Nonnull
+    @NotNull
     Map<String, String> getStats();
 
     /**

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreException.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreException.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreException.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStoreException.java
 Wed Jul 18 15:08:27 2018
@@ -16,14 +16,14 @@
  */
 package org.apache.jackrabbit.oak.plugins.document;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
 import com.google.common.collect.Lists;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static java.util.Collections.emptyList;
 
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
 /**
  * <code>DocumentStoreException</code> is a runtime exception for
  * {@code DocumentStore} implementations to signal unexpected problems like
@@ -110,7 +110,7 @@ public class DocumentStoreException exte
      * @param t a {@code Throwable}.
      * @return a {@link Type#GENERIC} DocumentStoreException.
      */
-    public static DocumentStoreException convert(@Nonnull Throwable t) {
+    public static DocumentStoreException convert(@NotNull Throwable t) {
         return convert(t, t.getMessage());
     }
 
@@ -127,7 +127,7 @@ public class DocumentStoreException exte
      * @param msg a message for the {@code DocumentStoreException}.
      * @return a {@link Type#GENERIC} DocumentStoreException.
      */
-    public static DocumentStoreException convert(@Nonnull Throwable t, String 
msg) {
+    public static DocumentStoreException convert(@NotNull Throwable t, String 
msg) {
         return asDocumentStoreException(msg, t, Type.GENERIC, emptyList());
     }
 
@@ -145,7 +145,7 @@ public class DocumentStoreException exte
      *            operation that triggered this exception.
      * @return a {@link Type#GENERIC} DocumentStoreException.
      */
-    public static DocumentStoreException convert(@Nonnull Throwable t,
+    public static DocumentStoreException convert(@NotNull Throwable t,
                                                  Iterable<String> ids) {
         return asDocumentStoreException(t.getMessage(), t, Type.GENERIC, ids);
     }
@@ -187,7 +187,7 @@ public class DocumentStoreException exte
         return type;
     }
 
-    @CheckForNull
+    @Nullable
     private static String getMessage(Throwable t) {
         return t == null ? null : t.toString();
     }

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ExternalChange.java
 Wed Jul 18 15:08:27 2018
@@ -22,14 +22,13 @@ import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Consumer;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.commons.sort.StringSort;
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
 import org.apache.jackrabbit.oak.spi.observation.ChangeSetBuilder;
 import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -68,7 +67,7 @@ abstract class ExternalChange {
      *
      * @param paths the paths of affected nodes.
      */
-    abstract void invalidateCache(@Nonnull Iterable<String> paths);
+    abstract void invalidateCache(@NotNull Iterable<String> paths);
 
     /**
      * Called when all cache entries must be invalidated.
@@ -85,8 +84,8 @@ abstract class ExternalChange {
      * @param changedPaths paths of nodes that are affected by those external
      *                     changes.
      */
-    abstract void updateHead(@Nonnull Set<Revision> externalChanges,
-                             @Nonnull RevisionVector sweepRevisions,
+    abstract void updateHead(@NotNull Set<Revision> externalChanges,
+                             @NotNull RevisionVector sweepRevisions,
                              @Nullable Iterable<String> changedPaths);
 
     /**

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FailedWithConflictException.java
 Wed Jul 18 15:08:27 2018
@@ -16,9 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.document;
 
-import javax.annotation.Nonnull;
-
 import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.jetbrains.annotations.NotNull;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
@@ -33,9 +32,9 @@ class FailedWithConflictException extend
 
     private final Set<Revision> conflictRevisions;
 
-    FailedWithConflictException(@Nonnull Set<Revision> conflictRevisions,
-                                @Nonnull String message,
-                                @Nonnull Throwable cause) {
+    FailedWithConflictException(@NotNull Set<Revision> conflictRevisions,
+                                @NotNull String message,
+                                @NotNull Throwable cause) {
         super(OAK, MERGE, 4, checkNotNull(message), checkNotNull(cause));
         this.conflictRevisions = checkNotNull(conflictRevisions);
     }
@@ -43,8 +42,8 @@ class FailedWithConflictException extend
     /**
      * @return the revision of another commit which caused a conflict.
      */
-    @Nonnull
+    @NotNull
     Set<Revision> getConflictRevisions() {
         return conflictRevisions;
     }
-}
\ No newline at end of file
+}

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/FormatVersion.java
 Wed Jul 18 15:08:27 2018
@@ -18,8 +18,6 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.util.List;
 
-import javax.annotation.Nonnull;
-
 import com.google.common.collect.ComparisonChain;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
@@ -27,6 +25,8 @@ import com.google.common.collect.Lists;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.apache.jackrabbit.oak.plugins.document.Collection.SETTINGS;
 
+import org.jetbrains.annotations.NotNull;
+
 /**
  * The format version currently in use by the DocumentNodeStore and written
  * to the underlying DocumentStore. A version {@link #canRead} the current or
@@ -135,8 +135,8 @@ public final class FormatVersion impleme
      * @throws DocumentStoreException if an error occurs while reading from the
      *          store.
      */
-    @Nonnull
-    public static FormatVersion versionOf(@Nonnull DocumentStore store)
+    @NotNull
+    public static FormatVersion versionOf(@NotNull DocumentStore store)
             throws DocumentStoreException {
         checkNotNull(store);
         FormatVersion v = V0;
@@ -175,7 +175,7 @@ public final class FormatVersion impleme
      *      are active cluster nodes using an existing version, 3) the version
      *      was changed concurrently.
      */
-    public boolean writeTo(@Nonnull DocumentStore store)
+    public boolean writeTo(@NotNull DocumentStore store)
             throws DocumentStoreException {
         checkNotNull(store);
         FormatVersion v = versionOf(store);
@@ -258,7 +258,7 @@ public final class FormatVersion impleme
     }
 
     @Override
-    public int compareTo(@Nonnull FormatVersion other) {
+    public int compareTo(@NotNull FormatVersion other) {
         checkNotNull(other);
         return ComparisonChain.start()
                 .compare(major, other.major)

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalDiffLoader.java
 Wed Jul 18 15:08:27 2018
@@ -20,16 +20,14 @@ import java.io.IOException;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import com.google.common.base.Stopwatch;
 
 import org.apache.jackrabbit.oak.cache.CacheStats;
 import org.apache.jackrabbit.oak.commons.sort.StringSort;
 import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -54,9 +52,9 @@ class JournalDiffLoader implements DiffC
 
     private Stats stats;
 
-    JournalDiffLoader(@Nonnull AbstractDocumentNodeState base,
-                      @Nonnull AbstractDocumentNodeState node,
-                      @Nonnull DocumentNodeStore ns) {
+    JournalDiffLoader(@NotNull AbstractDocumentNodeState base,
+                      @NotNull AbstractDocumentNodeState node,
+                      @NotNull DocumentNodeStore ns) {
         this.base = checkNotNull(base);
         this.node = checkNotNull(node);
         this.ns = checkNotNull(ns);
@@ -181,7 +179,7 @@ class JournalDiffLoader implements DiffC
         }
     }
 
-    @Nonnull
+    @NotNull
     private RevisionVector getBaseRevision(RevisionVector rv) {
         if (!rv.isBranch()) {
             return rv;
@@ -256,29 +254,29 @@ class JournalDiffLoader implements DiffC
             this.stats = stats;
         }
 
-        @CheckForNull
+        @Nullable
         String getChanges() {
             return changes;
         }
 
         @Override
-        String getChanges(@Nonnull RevisionVector from,
-                          @Nonnull RevisionVector to,
-                          @Nonnull String path,
+        String getChanges(@NotNull RevisionVector from,
+                          @NotNull RevisionVector to,
+                          @NotNull String path,
                           @Nullable Loader loader) {
             return cache.getChanges(from, to, path, loader);
         }
 
-        @Nonnull
+        @NotNull
         @Override
-        Entry newEntry(@Nonnull final RevisionVector from,
-                       @Nonnull final RevisionVector to,
+        Entry newEntry(@NotNull final RevisionVector from,
+                       @NotNull final RevisionVector to,
                        boolean local) {
             final Entry entry = cache.newEntry(from, to, local);
             return new Entry() {
                 @Override
-                public void append(@Nonnull String path,
-                                   @Nonnull String changes) {
+                public void append(@NotNull String path,
+                                   @NotNull String changes) {
                     trackStats(path, from, to, changes);
                     entry.append(path, changes);
                     if (path.equals(WrappedDiffCache.this.path)) {
@@ -304,7 +302,7 @@ class JournalDiffLoader implements DiffC
             stats.valueMemory += new StringValue(changes).getMemory();
         }
 
-        @Nonnull
+        @NotNull
         @Override
         Iterable<CacheStats> getStats() {
             return cache.getStats();

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JournalEntry.java
 Wed Jul 18 15:08:27 2018
@@ -25,10 +25,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.function.Consumer;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import com.google.common.collect.AbstractIterator;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -42,6 +38,8 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
 import org.apache.jackrabbit.oak.spi.observation.ChangeSet;
 import org.apache.jackrabbit.oak.spi.observation.ChangeSetBuilder;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -128,11 +126,11 @@ public final class JournalEntry extends
         });
     }
 
-    static void applyTo(@Nonnull Iterable<String> changedPaths,
-                        @Nonnull DiffCache diffCache,
-                        @Nonnull String path,
-                        @Nonnull RevisionVector from,
-                        @Nonnull RevisionVector to) throws IOException {
+    static void applyTo(@NotNull Iterable<String> changedPaths,
+                        @NotNull DiffCache diffCache,
+                        @NotNull String path,
+                        @NotNull RevisionVector from,
+                        @NotNull RevisionVector to) throws IOException {
         LOG.debug("applyTo: starting for {} from {} to {}", path, from, to);
         // note that it is not de-duplicated yet
         LOG.debug("applyTo: sorting done.");
@@ -234,11 +232,11 @@ public final class JournalEntry extends
      * @throws IOException if adding external changes to the {@code StringSort}
      *          instances fails with an exception.
      */
-    static int fillExternalChanges(@Nonnull StringSort externalChanges,
-                                   @Nonnull StringSort invalidate,
-                                   @Nonnull Revision from,
-                                   @Nonnull Revision to,
-                                   @Nonnull DocumentStore store)
+    static int fillExternalChanges(@NotNull StringSort externalChanges,
+                                   @NotNull StringSort invalidate,
+                                   @NotNull Revision from,
+                                   @NotNull Revision to,
+                                   @NotNull DocumentStore store)
             throws IOException {
         return fillExternalChanges(externalChanges, invalidate, ROOT_PATH,
                 from, to, store, entry -> {}, null, null);
@@ -270,13 +268,13 @@ public final class JournalEntry extends
      * @throws IOException if adding external changes to the {@code StringSort}
      *          instances fails with an exception.
      */
-    static int fillExternalChanges(@Nonnull StringSort externalChanges,
-                                   @Nonnull StringSort invalidate,
-                                   @Nonnull String path,
-                                   @Nonnull Revision from,
-                                   @Nonnull Revision to,
-                                   @Nonnull DocumentStore store,
-                                   @Nonnull Consumer<JournalEntry> 
journalEntryConsumer,
+    static int fillExternalChanges(@NotNull StringSort externalChanges,
+                                   @NotNull StringSort invalidate,
+                                   @NotNull String path,
+                                   @NotNull Revision from,
+                                   @NotNull Revision to,
+                                   @NotNull DocumentStore store,
+                                   @NotNull Consumer<JournalEntry> 
journalEntryConsumer,
                                    @Nullable ChangeSetBuilder changeSetBuilder,
                                    @Nullable JournalPropertyHandler 
journalPropertyHandler)
             throws IOException {
@@ -343,13 +341,13 @@ public final class JournalEntry extends
         return numEntries;
     }
 
-    private static void fillFromJournalEntry(@Nonnull StringSort 
externalChanges,
-                                             @Nonnull StringSort invalidate,
-                                             @Nonnull String path,
+    private static void fillFromJournalEntry(@NotNull StringSort 
externalChanges,
+                                             @NotNull StringSort invalidate,
+                                             @NotNull String path,
                                              @Nullable ChangeSetBuilder 
changeSetBuilder,
                                              @Nullable JournalPropertyHandler 
journalPropertyHandler,
-                                             @Nonnull JournalEntry d,
-                                             @Nonnull Consumer<JournalEntry> 
journalEntryConsumer)
+                                             @NotNull JournalEntry d,
+                                             @NotNull Consumer<JournalEntry> 
journalEntryConsumer)
             throws IOException {
         d.addTo(externalChanges, path);
         d.addInvalidateOnlyTo(invalidate);
@@ -417,7 +415,7 @@ public final class JournalEntry extends
         changeSetBuilder.add(set);
     }
 
-    void branchCommit(@Nonnull Iterable<Revision> revisions) {
+    void branchCommit(@NotNull Iterable<Revision> revisions) {
         if (!revisions.iterator().hasNext()) {
             return;
         }
@@ -435,7 +433,7 @@ public final class JournalEntry extends
         put(BRANCH_COMMITS, branchCommits);
     }
 
-    UpdateOp asUpdateOp(@Nonnull Revision revision) {
+    UpdateOp asUpdateOp(@NotNull Revision revision) {
         String id = asId(revision);
         UpdateOp op = new UpdateOp(id, true);
         op.set(CHANGES, getChanges().serialize());
@@ -468,7 +466,7 @@ public final class JournalEntry extends
      *
      * @param revisions the references to invalidate-only journal entries.
      */
-    void invalidate(@Nonnull Iterable<Revision> revisions) {
+    void invalidate(@NotNull Iterable<Revision> revisions) {
         String value = (String) get(INVALIDATE_ONLY);
         if (value == null) {
             value = "";
@@ -515,7 +513,7 @@ public final class JournalEntry extends
      *
      * @return the branch commits.
      */
-    @Nonnull
+    @NotNull
     Iterable<JournalEntry> getBranchCommits() {
         return getLinkedEntries(BRANCH_COMMITS);
     }
@@ -555,7 +553,7 @@ public final class JournalEntry extends
      *
      * @return the invalidate-only entries.
      */
-    @Nonnull
+    @NotNull
     private Iterable<JournalEntry> getInvalidateOnly() {
         return getLinkedEntries(INVALIDATE_ONLY);
     }
@@ -605,7 +603,7 @@ public final class JournalEntry extends
         return builder.toString();
     }
 
-    static String asId(@Nonnull Revision revision) {
+    static String asId(@NotNull Revision revision) {
         checkNotNull(revision);
         String s = String.format(REVISION_FORMAT, revision.getClusterId(), 
revision.getTimestamp(), revision.getCounter());
         if (revision.isBranch()) {
@@ -614,7 +612,7 @@ public final class JournalEntry extends
         return s;
     }
 
-    @CheckForNull
+    @Nullable
     private TreeNode getNode(String path) {
         TreeNode node = getChanges();
         for (String name : PathUtils.elements(path)) {
@@ -626,7 +624,7 @@ public final class JournalEntry extends
         return node;
     }
 
-    @Nonnull
+    @NotNull
     private TreeNode getChanges() {
         if (changes == null) {
             TreeNode node = new TreeNode(concurrent);
@@ -685,7 +683,7 @@ public final class JournalEntry extends
             return false;
         }
 
-        @Nonnull
+        @NotNull
         private TreeNode getRoot() {
             TreeNode n = this;
             while (n.parent != null) {
@@ -733,12 +731,12 @@ public final class JournalEntry extends
             return builder.toString();
         }
 
-        @Nonnull
+        @NotNull
         Set<String> keySet() {
             return children.keySet();
         }
 
-        @CheckForNull
+        @Nullable
         TreeNode get(String name) {
             return children.get(name);
         }
@@ -759,7 +757,7 @@ public final class JournalEntry extends
             }
         }
 
-        @Nonnull
+        @NotNull
         private TreeNode getOrCreate(String name) {
             if (children == NO_CHILDREN) {
                 children = mapFactory.newMap();

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/JsopNodeStateDiffer.java
 Wed Jul 18 15:08:27 2018
@@ -16,11 +16,10 @@
  */
 package org.apache.jackrabbit.oak.plugins.document;
 
-import javax.annotation.Nonnull;
-
 import org.apache.jackrabbit.oak.spi.state.AbstractNodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * A {@link NodeStateDiffer} implementation backed by a JSOP String.
@@ -40,9 +39,9 @@ class JsopNodeStateDiffer implements Nod
     }
 
     @Override
-    public boolean compare(@Nonnull final AbstractDocumentNodeState node,
-                           @Nonnull final AbstractDocumentNodeState base,
-                           @Nonnull final NodeStateDiff diff) {
+    public boolean compare(@NotNull final AbstractDocumentNodeState node,
+                           @NotNull final AbstractDocumentNodeState base,
+                           @NotNull final NodeStateDiff diff) {
         if (!withoutPropertyChanges) {
             if (!AbstractNodeState.comparePropertiesAgainstBaseState(node, 
base, diff)) {
                 return false;

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java
 Wed Jul 18 15:08:27 2018
@@ -35,8 +35,6 @@ import java.util.concurrent.atomic.Atomi
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.function.Consumer;
 
-import javax.annotation.CheckForNull;
-
 import com.google.common.base.Predicate;
 import com.google.common.base.Supplier;
 import com.google.common.collect.Iterables;
@@ -46,6 +44,7 @@ import org.apache.jackrabbit.oak.commons
 import org.apache.jackrabbit.oak.plugins.document.util.MapFactory;
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
 import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -526,7 +525,7 @@ public class LastRevRecoveryAgent {
      * @return the commit revision of the last modification by {@code 
clusterId}
      *          to the given document.
      */
-    @CheckForNull
+    @Nullable
     private Revision determineLastModification(NodeDocument doc, int 
clusterId) {
         ClusterPredicate cp = new ClusterPredicate(clusterId);
 

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevs.java
 Wed Jul 18 15:08:27 2018
@@ -21,11 +21,9 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Helper class to track when a node was last modified.
@@ -73,7 +71,7 @@ final class LastRevs implements Iterable
         }
     }
 
-    @CheckForNull
+    @Nullable
     Revision getBranchRevision() {
         return branchRev;
     }

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LocalDiffCache.java
 Wed Jul 18 15:08:27 2018
@@ -19,9 +19,6 @@ package org.apache.jackrabbit.oak.plugin
 import java.util.Collections;
 import java.util.Map;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import com.google.common.cache.Cache;
 import com.google.common.collect.Maps;
 
@@ -32,6 +29,8 @@ import org.apache.jackrabbit.oak.commons
 import org.apache.jackrabbit.oak.commons.json.JsopTokenizer;
 import org.apache.jackrabbit.oak.plugins.document.util.RevisionsKey;
 import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,9 +56,9 @@ public class LocalDiffCache extends Diff
     }
 
     @Override
-    public String getChanges(@Nonnull RevisionVector from,
-                             @Nonnull RevisionVector to,
-                             @Nonnull String path,
+    public String getChanges(@NotNull RevisionVector from,
+                             @NotNull RevisionVector to,
+                             @NotNull String path,
                              @Nullable Loader loader) {
         RevisionsKey key = new RevisionsKey(from, to);
         Diff diff = diffCache.getIfPresent(key);
@@ -73,16 +72,16 @@ public class LocalDiffCache extends Diff
         return null;
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public Entry newEntry(final @Nonnull RevisionVector from,
-                          final @Nonnull RevisionVector to,
+    public Entry newEntry(final @NotNull RevisionVector from,
+                          final @NotNull RevisionVector to,
                           boolean local /*ignored*/) {
         return new Entry() {
             private final Map<String, String> changesPerPath = 
Maps.newHashMap();
             private long size;
             @Override
-            public void append(@Nonnull String path, @Nonnull String changes) {
+            public void append(@NotNull String path, @NotNull String changes) {
                 if (exceedsSize()){
                     return;
                 }
@@ -107,7 +106,7 @@ public class LocalDiffCache extends Diff
         };
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public Iterable<CacheStats> getStats() {
         return Collections.singleton(diffCacheStats);

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MemoryDiffCache.java
 Wed Jul 18 15:08:27 2018
@@ -20,12 +20,10 @@ import java.util.Collections;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import org.apache.jackrabbit.oak.cache.CacheStats;
 import org.apache.jackrabbit.oak.plugins.document.util.StringValue;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import com.google.common.cache.Cache;
 import org.slf4j.Logger;
@@ -65,11 +63,11 @@ public class MemoryDiffCache extends Dif
                 builder.getWeigher(), builder.getMemoryDiffCacheSize());
     }
 
-    @CheckForNull
+    @Nullable
     @Override
-    public String getChanges(@Nonnull final RevisionVector from,
-                             @Nonnull final RevisionVector to,
-                             @Nonnull final String path,
+    public String getChanges(@NotNull final RevisionVector from,
+                             @NotNull final RevisionVector to,
+                             @NotNull final String path,
                              @Nullable final Loader loader) {
         PathRev key = diffCacheKey(path, from, to);
         StringValue diff;
@@ -98,15 +96,15 @@ public class MemoryDiffCache extends Dif
         return diff != null ? diff.toString() : null;
     }
 
-    @Nonnull
+    @NotNull
     @Override
-    public Entry newEntry(@Nonnull RevisionVector from,
-                          @Nonnull RevisionVector to,
+    public Entry newEntry(@NotNull RevisionVector from,
+                          @NotNull RevisionVector to,
                           boolean local /*ignored*/) {
         return new MemoryEntry(from, to);
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public Iterable<CacheStats> getStats() {
         return Collections.singleton(diffCacheStats);
@@ -123,7 +121,7 @@ public class MemoryDiffCache extends Dif
         }
 
         @Override
-        public void append(@Nonnull String path, @Nonnull String changes) {
+        public void append(@NotNull String path, @NotNull String changes) {
             PathRev key = diffCacheKey(path, from, to);
             if (changes.length() > CACHE_VALUE_LIMIT) {
                 LOG.warn("Not caching entry for {} from {} to {}. Length of 
changes is {}.",
@@ -140,9 +138,9 @@ public class MemoryDiffCache extends Dif
         }
     }
 
-    private static PathRev diffCacheKey(@Nonnull String path,
-                                        @Nonnull RevisionVector from,
-                                        @Nonnull RevisionVector to) {
+    private static PathRev diffCacheKey(@NotNull String path,
+                                        @NotNull RevisionVector from,
+                                        @NotNull RevisionVector to) {
         return new PathRev(from + path, to);
     }
 
@@ -159,17 +157,17 @@ public class MemoryDiffCache extends Dif
      * @return {@code true} if there are cache entries that indicate the node
      *      at the given path was modified between the two revisions.
      */
-    private boolean isUnchanged(@Nonnull final RevisionVector from,
-                                @Nonnull final RevisionVector to,
-                                @Nonnull final String path) {
+    private boolean isUnchanged(@NotNull final RevisionVector from,
+                                @NotNull final RevisionVector to,
+                                @NotNull final String path) {
         return !denotesRoot(path)
                 && isChildUnchanged(from, to, getParentPath(path), 
getName(path));
     }
 
-    private boolean isChildUnchanged(@Nonnull final RevisionVector from,
-                                     @Nonnull final RevisionVector to,
-                                     @Nonnull final String parent,
-                                     @Nonnull final String name) {
+    private boolean isChildUnchanged(@NotNull final RevisionVector from,
+                                     @NotNull final RevisionVector to,
+                                     @NotNull final String parent,
+                                     @NotNull final String name) {
         PathRev parentKey = diffCacheKey(parent, from, to);
         StringValue parentCachedEntry = diffCache.getIfPresent(parentKey);
         boolean unchanged;

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MergeCommit.java
 Wed Jul 18 15:08:27 2018
@@ -19,10 +19,10 @@ package org.apache.jackrabbit.oak.plugin
 import java.util.Set;
 import java.util.SortedSet;
 
-import javax.annotation.Nonnull;
-
 import com.google.common.collect.Sets;
 
+import org.jetbrains.annotations.NotNull;
+
 /**
  * A merge commit containing multiple commit revisions. One for each branch
  * commit to merge.
@@ -43,7 +43,7 @@ class MergeCommit extends Commit {
         return mergeRevs;
     }
 
-    void addBranchCommits(@Nonnull Branch branch) {
+    void addBranchCommits(@NotNull Branch branch) {
         for (Revision r : branch.getCommits()) {
             if (!branch.getCommit(r).isRebase()) {
                 branchCommits.add(r);

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java?rev=1836194&r1=1836193&r2=1836194&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeeker.java
 Wed Jul 18 15:08:27 2018
@@ -21,11 +21,10 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.util.stream.StreamSupport;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
 import org.apache.jackrabbit.oak.stats.Clock;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
@@ -56,7 +55,7 @@ public class MissingLastRevSeeker {
      *
      * @return the clusters
      */
-    @Nonnull
+    @NotNull
     public Iterable<ClusterNodeInfoDocument> getAllClusters() {
         return ClusterNodeInfoDocument.all(store);
     }
@@ -67,7 +66,7 @@ public class MissingLastRevSeeker {
      * @param clusterId the cluster id
      * @return the cluster node info
      */
-    @CheckForNull
+    @Nullable
     public ClusterNodeInfoDocument getClusterNodeInfo(final int clusterId) {
         // Fetch all documents.
         return store.find(CLUSTER_NODES, String.valueOf(clusterId));
@@ -80,7 +79,7 @@ public class MissingLastRevSeeker {
      * @param startTime the start time in milliseconds.
      * @return the candidates
      */
-    @Nonnull
+    @NotNull
     public Iterable<NodeDocument> getCandidates(final long startTime) {
         // Fetch all documents where lastmod >= startTime
         Iterable<NodeDocument> nodes = getSelectedDocuments(store,
@@ -149,7 +148,7 @@ public class MissingLastRevSeeker {
      * @deprecated use {@link ClusterNodeInfoDocument#isRecoveryNeeded(long)}
      *          instead.
      */
-    public boolean isRecoveryNeeded(@Nonnull ClusterNodeInfoDocument nodeInfo) 
{
+    public boolean isRecoveryNeeded(@NotNull ClusterNodeInfoDocument nodeInfo) 
{
         return nodeInfo.isRecoveryNeeded(clock.getTime());
     }
 }


Reply via email to