jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1537527 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk: ./ util/
Date Thu, 31 Oct 2013 15:18:29 GMT
Author: thomasm
Date: Thu Oct 31 15:18:28 2013
New Revision: 1537527

URL: http://svn.apache.org/r1537527
Log:
OAK-98 Remove unused imports, Javadocs, Source code formatting

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CommitQueue.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoRootBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnsavedModifications.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ValueMap.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MergeSortedIterators.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Branch.java
Thu Oct 31 15:18:28 2013
@@ -16,18 +16,15 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
-import java.util.NavigableMap;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.SortedSet;
-import java.util.TreeMap;
-import java.util.TreeSet;
 import java.util.concurrent.ConcurrentSkipListMap;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
  * Contains commit information about a branch and its base revision.
  */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CommitQueue.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CommitQueue.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CommitQueue.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/CommitQueue.java
Thu Oct 31 15:18:28 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.concurrent.CountDownLatch;
@@ -29,16 +31,13 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
  * <code>CommitQueue</code> ensures a sequence of commits consistent with the
  * commit revision even if commits did not complete in this sequence.
  */
 class CommitQueue {
 
-    private static final Logger LOG = LoggerFactory.getLogger(CommitQueue.class);
+    static final Logger LOG = LoggerFactory.getLogger(CommitQueue.class);
 
     private final MongoNodeStore store;
 
@@ -88,7 +87,7 @@ class CommitQueue {
     }
 
     private void afterTrunkCommit(Commit c, CommitInfo info) {
-        assert(!commits.isEmpty());
+        assert !commits.isEmpty();
 
         boolean isHead;
         Entry commitEntry;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
Thu Oct 31 15:18:28 2013
@@ -357,7 +357,7 @@ public class MemoryDocumentStore impleme
 
     @Override
     public <T extends Document> T getIfCached(Collection<T> collection, String
key) {
-        return find(collection,key);
+        return find(collection, key);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
Thu Oct 31 15:18:28 2013
@@ -573,11 +573,11 @@ public class MongoDocumentStore implemen
     }
     
     @Override
-    public <T extends Document> T getIfCached(Collection<T> collection, String
key){
+    public <T extends Document> T getIfCached(Collection<T> collection, String
key) {
         if (collection != Collection.NODES) {
             return null;
         }
-        return (T)nodesCache.getIfPresent(key);
+        return (T) nodesCache.getIfPresent(key);
     }
 
 
@@ -641,7 +641,7 @@ public class MongoDocumentStore implemen
      *          in the cache.
      */
     @Nonnull
-    private NodeDocument addToCache(final @Nonnull NodeDocument doc) {
+    private NodeDocument addToCache(@Nonnull final NodeDocument doc) {
         if (doc == NodeDocument.NULL) {
             throw new IllegalArgumentException("doc must not be NULL document");
         }
@@ -673,7 +673,7 @@ public class MongoDocumentStore implemen
     }
 
     @Nonnull
-    private QueryBuilder createQueryForUpdate(UpdateOp updateOp,
+    private static QueryBuilder createQueryForUpdate(UpdateOp updateOp,
                                               boolean checkConditions) {
         QueryBuilder query = getByKeyQuery(updateOp.id);
 
@@ -699,7 +699,7 @@ public class MongoDocumentStore implemen
      * @return the DBObject.
      */
     @Nonnull
-    private DBObject createUpdate(UpdateOp updateOp) {
+    private static DBObject createUpdate(UpdateOp updateOp) {
         BasicDBObject setUpdates = new BasicDBObject();
         BasicDBObject incUpdates = new BasicDBObject();
         BasicDBObject unsetUpdates = new BasicDBObject();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
Thu Oct 31 15:18:28 2013
@@ -291,7 +291,7 @@ public class MongoMK implements MicroKer
         }
     }
 
-    private void addPathsForDiff(String path,
+    private static void addPathsForDiff(String path,
                                  Set<String> paths,
                                  UnsavedModifications pending,
                                  Revision minRev) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeState.java
Thu Oct 31 15:18:28 2013
@@ -194,14 +194,16 @@ final class MongoNodeState extends Abstr
     public boolean compareAgainstBaseState(NodeState base, NodeStateDiff diff) {
         if (this == base) {
             return true;
-        } else if (base == EMPTY_NODE || !base.exists()) { // special case
+        } else if (base == EMPTY_NODE || !base.exists()) { 
+            // special case
             return EmptyNodeState.compareAgainstEmptyState(this, diff);
         } else if (base instanceof MongoNodeState) {
             MongoNodeState mBase = (MongoNodeState) base;
             if (store == mBase.store) {
                 if (node.getLastRevision().equals(mBase.node.getLastRevision())
                         && getPath().equals(mBase.getPath())) {
-                    return true; // no differences
+                    // no differences
+                    return true; 
                 }
                 // TODO: use diff, similar to KernelNodeState
             }
@@ -220,7 +222,7 @@ final class MongoNodeState extends Abstr
      * @param reader  The reader
      * @return new property state
      */
-    private PropertyState readProperty(String name, JsopReader reader) {
+    PropertyState readProperty(String name, JsopReader reader) {
         if (reader.matches(JsopReader.NUMBER)) {
             String number = reader.getToken();
             try {
@@ -263,7 +265,7 @@ final class MongoNodeState extends Abstr
      * @param reader  The reader
      * @return new property state
      */
-    private PropertyState readArrayProperty(String name, JsopReader reader) {
+    PropertyState readArrayProperty(String name, JsopReader reader) {
         int type = PropertyType.STRING;
         List<Object> values = Lists.newArrayList();
         while (!reader.matches(']')) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoNodeStore.java
Thu Oct 31 15:18:28 2013
@@ -501,8 +501,8 @@ public final class MongoNodeStore
 
         //Preemptive check. If we know there are no child then
         //return straight away
-        final Node node = getNode(path,rev);
-        if(node.hasNoChildren()){
+        final Node node = getNode(path, rev);
+        if (node.hasNoChildren()) {
             return new Node.Children();
         }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoRootBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoRootBuilder.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoRootBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoRootBuilder.java
Thu Oct 31 15:18:28 2013
@@ -56,7 +56,7 @@ class MongoRootBuilder extends MongoNode
     /**
      * Number of updated not yet persisted to the private {@link #branch}
      */
-    private int updates = 0;
+    private int updates;
 
     MongoRootBuilder(MongoNodeState base, MongoNodeStore store) {
         super(checkNotNull(base));

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
Thu Oct 31 15:18:28 2013
@@ -46,10 +46,10 @@ public class Node implements CacheValue 
     final boolean hasChildren;
     
     Node(String path, Revision rev) {
-       this(path,rev,false);
+        this(path, rev, false);
     }
 
-    Node(String path, Revision rev,boolean hasChildren) {
+    Node(String path, Revision rev, boolean hasChildren) {
         this.path = path;
         this.rev = rev;
         this.hasChildren = hasChildren;
@@ -75,7 +75,7 @@ public class Node implements CacheValue 
         newNode.properties.putAll(properties);
     }
 
-    public boolean hasNoChildren(){
+    public boolean hasNoChildren() {
         return !hasChildren;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnmergedBranches.java
Thu Oct 31 15:18:28 2013
@@ -16,7 +16,9 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
-import java.util.ArrayList;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.Comparator;
 import java.util.List;
 import java.util.SortedMap;
@@ -30,9 +32,6 @@ import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.plugins.mongomk.util.Utils;
 
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
  * <code>UnmergedBranches</code> contains all un-merged branches of a MongoMK
  * instance.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnsavedModifications.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnsavedModifications.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnsavedModifications.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/UnsavedModifications.java
Thu Oct 31 15:18:28 2013
@@ -23,7 +23,6 @@ import java.util.concurrent.ConcurrentHa
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 
 import com.google.common.base.Function;
 import com.google.common.base.Predicate;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ValueMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ValueMap.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ValueMap.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ValueMap.java
Thu Oct 31 15:18:28 2013
@@ -38,12 +38,12 @@ import com.google.common.collect.Iterato
  */
 class ValueMap {
 
-    static SortedMap<Revision, String> EMPTY = Collections.unmodifiableSortedMap(
+    static final SortedMap<Revision, String> EMPTY = Collections.unmodifiableSortedMap(
             new TreeMap<Revision, String>(new StableRevisionComparator()));
 
     @Nonnull
-    static Map<Revision, String> create(final @Nonnull NodeDocument doc,
-                                        final @Nonnull String property) {
+    static Map<Revision, String> create(@Nonnull final NodeDocument doc,
+                @Nonnull final String property) {
         final SortedMap<Revision, String> map = doc.getLocalMap(property);
         if (doc.getPreviousRanges().isEmpty()) {
             return map;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MergeSortedIterators.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MergeSortedIterators.java?rev=1537527&r1=1537526&r2=1537527&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MergeSortedIterators.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MergeSortedIterators.java
Thu Oct 31 15:18:28 2013
@@ -33,6 +33,8 @@ import com.google.common.collect.Peeking
  * the provided Comparator. In addition the sequence of iterators must also
  * be sorted in a way that the first element of the next iterator is greater
  * than the first element of the previous iterator.
+ * 
+ * @param <T> the entry type
  */
 public abstract class MergeSortedIterators<T> implements Iterator<T> {
 



Mime
View raw message