jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1241538 - /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeLog.java
Date Tue, 07 Feb 2012 18:07:15 GMT
Author: mduerig
Date: Tue Feb  7 18:07:14 2012
New Revision: 1241538

URL: http://svn.apache.org/viewvc?rev=1241538&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- refine case 14' to detect invalid change logs. Correct comment

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeLog.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeLog.java?rev=1241538&r1=1241537&r2=1241538&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeLog.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeLog.java
Tue Feb  7 18:07:14 2012
@@ -200,7 +200,10 @@ public class ChangeLog {
       4'.  if s = NIL and q = NIL then m * n = -r. Otherwise if s = NIL then m, n do not
commute.
       10'. illegal if p = NIL
       12'. if s = NIL then m * n = -r * -p
-      14'. illegal if p = NIL
+      14'. if p = NIL: does not commute if the parent of s is q. Illegal otherwise
+
+      The cases which are marked illegal cannot occur in valid change logs. That is, if such
a
+      case occurred, the containing change log would be invalid.
      */
 
     /**
@@ -463,7 +466,13 @@ public class ChangeLog {
         else if (leq(m.to, n.to)) {  // q < s
             // See 14'.
             if (m.from == NIL) {
-                return false;
+                Path p = n.to.getParent();
+                if (p.equals(m.to)) {
+                    return false;
+                }
+                else {
+                    throw new IllegalArgumentException(m + ", " + n);
+                }
             }
             else {
                 ops.set(index, n.move(m.to, m.from));



Mime
View raw message