jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1352808 - /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
Date Fri, 22 Jun 2012 08:54:34 GMT
Author: jukka
Date: Fri Jun 22 08:54:33 2012
New Revision: 1352808

URL: http://svn.apache.org/viewvc?rev=1352808&view=rev
Log:
OAK-147: Incorrect Comparator in CommitBuilder.persistStagedNodes

Sort paths at equal depth lexicographically instead of always putting the first argument before
the second one

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java

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=1352808&r1=1352807&r2=1352808&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 Jun 22 08:54:33 2012
@@ -322,7 +322,11 @@ public class CommitBuilder {
             public int compare(String path1, String path2) {
                 // paths should be ordered by depth, descending
                 int result = getDepth(path2) - getDepth(path1);
-                return (result != 0) ? result : 1;
+                if (result != 0) {
+                    return result;
+                } else {
+                    return path2.compareTo(path1);
+                }
             }
 
             int getDepth(String path) {



Mime
View raw message