jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1305269 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
Date Mon, 26 Mar 2012 08:51:31 GMT
Author: mreutegg
Date: Mon Mar 26 08:51:31 2012
New Revision: 1305269

URL: http://svn.apache.org/viewvc?rev=1305269&view=rev
Log:
JCR-3275: Audit log

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java?rev=1305269&r1=1305268&r2=1305269&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
Mon Mar 26 08:51:31 2012
@@ -802,12 +802,21 @@ public final class EventStateCollection 
                 if (common == null) {
                     common = s;
                 } else if (!common.equals(s)) {
+
+                    // Assign the shorter path to common.
+                    if (s.length() < common.length()) {
+                        String temp = common;
+                        common = s;
+                        s = temp;
+                    }
+
+                    // Find the real common.
                     while (!s.startsWith(common)) {
                         int idx = s.lastIndexOf('/');
                         if (idx < 0) {
                             break;
                         }
-                        common = s.substring(0, idx);
+                        common = s.substring(0, idx + 1);
                     }
                 }
             }



Mime
View raw message