jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1226503 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state: ChangeTree.java NodeState.java TransientSpace.java
Date Mon, 02 Jan 2012 18:31:23 GMT
Author: mduerig
Date: Mon Jan  2 18:31:23 2012
New Revision: 1226503

URL: http://svn.apache.org/viewvc?rev=1226503&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- minor improvements

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java?rev=1226503&r1=1226502&r2=1226503&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
Mon Jan  2 18:31:23 2012
@@ -276,7 +276,7 @@ public class ChangeTree {
         public void visit(Moved delta) {
             if (!visited.contains(delta)) {
                 delta.source.accept(this);
-                listener.moveNode(delta.getSourcePath(), delta.getPath());
+                    listener.moveNode(delta.getSourcePath(), delta.getPath());
                 visited.add(delta);
                 handleProperties(delta);
                 visitNodes(delta);
@@ -759,7 +759,7 @@ public class ChangeTree {
 
         @Override
         public String toString() {
-            return "Moved[" + getPath() + ']';
+            return "Moved[" + getPath() + "] from " + source;
         }
 
         @Override
@@ -785,10 +785,10 @@ public class ChangeTree {
      * Represents a transiently removed node.
      */
     public class Removed extends NodeDelta {
-        private final NodeDelta removed;
-        private final NodeDelta movedTo;
+        private final Existing removed;
+        private final Moved movedTo;
 
-        Removed(NodeDelta parent, String name, NodeDelta removed, NodeDelta movedTo) {
+        Removed(NodeDelta parent, String name, Existing removed, Moved movedTo) {
             super(parent, name);
             this.removed = removed;
             this.movedTo = movedTo;
@@ -851,10 +851,13 @@ public class ChangeTree {
 
         @Override
         public String toString() {
-            return "Removed[" + getPath() + ']'
-                    + (isMoved() ? " to " + movedTo : "");
+            if (isMoved()) {
+                return "Moved[" + getPath() + "] to " + movedTo.getPath();
+            }
+            else {
+                return "Removed[" + getPath() + ']';
+            }
         }
-
     }
 
 }

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java?rev=1226503&r1=1226502&r2=1226503&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
Mon Jan  2 18:31:23 2012
@@ -77,7 +77,7 @@ public class NodeState {
     }
 
     public void remove() throws ItemNotFoundException {
-        nodeDelta.remove();
+        nodeDelta.remove();  // fixme: don't use internal API
         nodeStateCache().remove(getPath());
     }
 

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java?rev=1226503&r1=1226502&r2=1226503&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
Mon Jan  2 18:31:23 2012
@@ -83,14 +83,14 @@ public class TransientSpace {
                 public void addNode(Path path) {
                     jsop.append("+\"")
                             .append(path.toMkPath())
-                            .append("\":{}");
+                            .append("\":{}\n");
                 }
 
                 @Override
                 public void removeNode(Path path) {
                     jsop.append("-\"")
                             .append(path.toMkPath())
-                            .append('"');
+                            .append("\"\n");
                 }
 
                 @Override
@@ -99,7 +99,7 @@ public class TransientSpace {
                             .append(sourcePath.toMkPath())
                             .append("\":\"")
                             .append(destinationPath.toMkPath())
-                            .append('"');
+                            .append("\"\n");
                 }
 
                 @Override
@@ -107,14 +107,15 @@ public class TransientSpace {
                     jsop.append("^\"")
                             .append(path.toMkPath())
                             .append("\":")
-                            .append(value.toJson());
+                            .append(value.toJson())
+                            .append('\n');
                 }
 
                 @Override
                 public void removeProperty(Path path) {
                     jsop.append("^\"")
                             .append(path.toMkPath())
-                            .append("\":null");
+                            .append("\":null\n");
                 }
             });
 



Mime
View raw message