jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1358266 - in /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk: core/MicroKernelImpl.java model/CommitBuilder.java model/tree/AbstractNodeState.java store/DefaultRevisionStore.java
Date Fri, 06 Jul 2012 15:30:48 GMT
Author: stefan
Date: Fri Jul  6 15:30:48 2012
New Revision: 1358266

URL: http://svn.apache.org/viewvc?rev=1358266&view=rev
Log:
some minor improvements

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1358266&r1=1358265&r2=1358266&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Fri Jul  6 15:30:48 2012
@@ -702,11 +702,11 @@ public class MicroKernelImpl implements 
         }
 
         boolean includeNode(String name) {
-            return nodeFilter == null ? true : nodeFilter.matches(name);
+            return nodeFilter == null || nodeFilter.matches(name);
         }
 
         boolean includeProperty(String name) {
-            return propFilter == null ? true : propFilter.matches(name);
+            return propFilter == null || propFilter.matches(name);
         }
     }
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java?rev=1358266&r1=1358265&r2=1358266&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
Fri Jul  6 15:30:48 2012
@@ -448,11 +448,11 @@ public class CommitBuilder {
         public Map<String, String> props = new HashMap<String, String>();
         public Map<String, NodeTree> nodes = new HashMap<String, NodeTree>();
 
-        void toJson(StringBuffer buf) {
+        void toJson(StringBuilder buf) {
             toJson(buf, this);
         }
 
-        private static void toJson(StringBuffer buf, NodeTree node) {
+        private static void toJson(StringBuilder buf, NodeTree node) {
             buf.append('{');
             for (String name : node.props.keySet()) {
                 if (buf.charAt(buf.length() - 1) != '{')  {
@@ -494,7 +494,7 @@ public class CommitBuilder {
 
         @Override
         String asDiff() {
-            StringBuffer diff = new StringBuffer("+");
+            StringBuilder diff = new StringBuilder("+");
             diff.append('"').append(PathUtils.concat(parentNodePath, nodeName)).append("\":");
             node.toJson(diff);
             return diff.toString();
@@ -542,7 +542,7 @@ public class CommitBuilder {
 
         @Override
         String asDiff() {
-            StringBuffer diff = new StringBuffer("-");
+            StringBuilder diff = new StringBuilder("-");
             diff.append('"').append(nodePath).append('"');
             return diff.toString();
         }
@@ -596,7 +596,7 @@ public class CommitBuilder {
 
         @Override
         String asDiff() {
-            StringBuffer diff = new StringBuffer(">");
+            StringBuilder diff = new StringBuilder(">");
             diff.append('"').append(srcPath).append("\":\"").append(destPath).append('"');
             return diff.toString();
         }
@@ -639,7 +639,7 @@ public class CommitBuilder {
 
         @Override
         String asDiff() {
-            StringBuffer diff = new StringBuffer("*");
+            StringBuilder diff = new StringBuilder("*");
             diff.append('"').append(srcPath).append("\":\"").append(destPath).append('"');
             return diff.toString();
         }
@@ -670,7 +670,7 @@ public class CommitBuilder {
 
         @Override
         String asDiff() {
-            StringBuffer diff = new StringBuffer("^");
+            StringBuilder diff = new StringBuilder("^");
             diff.append('"').append(PathUtils.concat(nodePath, propName)).append("\":").append(propValue);
             return diff.toString();
         }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java?rev=1358266&r1=1358265&r2=1358266&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java
Fri Jul  6 15:30:48 2012
@@ -109,11 +109,7 @@ public abstract class AbstractNodeState 
             }
             childNodeCount++;
         }
-        if (childNodeCount != other.getChildNodeCount()) {
-            return false;
-        }
-
-        return true;
+        return childNodeCount == other.getChildNodeCount();
     }
 
     /**

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java?rev=1358266&r1=1358265&r2=1358266&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
Fri Jul  6 15:30:48 2012
@@ -37,6 +37,7 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Set;
 import java.util.TreeMap;
 import java.util.WeakHashMap;
 import java.util.concurrent.Executors;
@@ -540,8 +541,8 @@ public class DefaultRevisionStore extend
             gcpm.start();
             gcState.set(MARKING);
 
-            PutTokenImpl[] putTokens = this.putTokens.keySet().toArray(new PutTokenImpl[0]);
-            for (PutTokenImpl token : putTokens) {
+            PutTokenImpl[] tokens = putTokens.keySet().toArray(new PutTokenImpl[putTokens.size()]);
+            for (PutTokenImpl token : tokens) {
                 markNode(token.getLastModified());
             }
         } finally {



Mime
View raw message