jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1225805 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state: ChangeTree.java NodeState.java
Date Fri, 30 Dec 2011 11:22:14 GMT
Author: mduerig
Date: Fri Dec 30 11:22:14 2011
New Revision: 1225805

URL: http://svn.apache.org/viewvc?rev=1225805&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- missing check for null

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

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=1225805&r1=1225804&r2=1225805&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
Fri Dec 30 11:22:14 2011
@@ -412,14 +412,15 @@ public class ChangeTree {
         }
 
         /**
-         * @return  an iterator of all added properties.
+         * @return  an iterator of all added/modified properties.
          */
         public Iterator<Entry<String, JsonValue>> getProperties() {
-            return Iterators.filterIterator(properties.entrySet().iterator(), new Predicate<Entry<String,
JsonValue>>() {
-                @Override
-                public boolean evaluate(Entry<String, JsonValue> entry) {
-                    return entry.getValue() != null;
-                }
+            return Iterators.filterIterator(properties.entrySet().iterator(),
+                new Predicate<Entry<String, JsonValue>>() {
+                    @Override
+                    public boolean evaluate(Entry<String, JsonValue> entry) {
+                        return entry.getValue() != null;
+                    }
             });
         }
 
@@ -487,6 +488,9 @@ public class ChangeTree {
             // Resolve destination only *after* source has been removed in order
             // to make sure nodes on any common path prefix are already touched.
             NodeDelta destParent = ChangeTree.this.getNode(destParentPath);
+            if (destParent == null) {
+                throw new PathNotFoundException(destination.toJcrPath());
+            }
             source.moveTo(destParent, destination.getName());
         }
 

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=1225805&r1=1225804&r2=1225805&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
Fri Dec 30 11:22:14 2011
@@ -126,6 +126,7 @@ public class NodeState {
     }
 
     public Iterator<Entry<String, JsonValue>> getProperties() {
+        // fixme: correctly overlay modified properties and removed properties
         return Iterators.iteratorChain(getPersistedProperties(), nodeDelta.getProperties());
     }
 



Mime
View raw message