You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ad...@apache.org on 2017/02/28 13:43:10 UTC

svn commit: r1784739 - /jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java

Author: adulceanu
Date: Tue Feb 28 13:43:10 2017
New Revision: 1784739

URL: http://svn.apache.org/viewvc?rev=1784739&view=rev
Log:
OAK-5862 - Consistency check outputs wrong number of binary properties in debug messages

Modified:
    jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java

Modified: jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java?rev=1784739&r1=1784738&r2=1784739&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java (original)
+++ jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java Tue Feb 28 13:43:10 2017
@@ -297,17 +297,23 @@ public class ConsistencyChecker implemen
             debug("Traversing {0}", path);
             nodeCount++;
             for (PropertyState propertyState : node.getProperties()) {
-                debug("Checking {0}/{1}", path, propertyState);
                 Type<?> type = propertyState.getType();
+                boolean checked = false;
+                
                 if (type == BINARY) {
-                    traverse(propertyState.getValue(BINARY), checkBinaries);
+                    checked = traverse(propertyState.getValue(BINARY), checkBinaries);
                 } else if (type == BINARIES) {
                     for (Blob blob : propertyState.getValue(BINARIES)) {
-                        traverse(blob, checkBinaries);
+                        checked = checked | traverse(blob, checkBinaries);
                     }
                 } else {
-                    propertyCount++;
                     propertyState.getValue(type);
+                    propertyCount++;
+                    checked = true;
+                }
+                
+                if (checked) {
+                    debug("Checked {0}/{1}", path, propertyState);
                 }
             }
             
@@ -375,7 +381,7 @@ public class ConsistencyChecker implemen
         }
     }
 
-    private void traverse(Blob blob, boolean checkBinaries) throws IOException {
+    private boolean traverse(Blob blob, boolean checkBinaries) throws IOException {
         if (checkBinaries && !isExternal(blob)) {
             InputStream s = blob.getNewStream();
             try {
@@ -389,7 +395,10 @@ public class ConsistencyChecker implemen
             }
             
             propertyCount++;
+            return true;
         }
+        
+        return false;
     }
 
     private static boolean isExternal(Blob b) {