jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1464628 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
Date Thu, 04 Apr 2013 16:51:55 GMT
Author: jukka
Date: Thu Apr  4 16:51:55 2013
New Revision: 1464628

URL: http://svn.apache.org/r1464628
Log:
OAK-709: Consider moving permission evaluation to the node state level

Fix SegmentMK use of the now @Nonnull getChildNode() method

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java?rev=1464628&r1=1464627&r2=1464628&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Template.java
Thu Apr  4 16:51:55 2013
@@ -380,12 +380,12 @@ class Template {
             NodeState afterNode = getChildNode(childName, store, afterId);
             NodeState beforeNode = beforeTemplate.getChildNode(
                     childName, store, beforeId);
-            if (beforeNode == null) {
+            if (!beforeNode.exists()) {
                 diff.childNodeAdded(childName, afterNode);
             } else if (!beforeNode.equals(afterNode)) {
                 diff.childNodeChanged(childName, beforeNode, afterNode);
             }
-            if ((beforeTemplate.hasOneChildNode() && beforeNode == null)
+            if ((beforeTemplate.hasOneChildNode() && !beforeNode.exists())
                     || beforeTemplate.hasManyChildNodes()) {
                 for (ChildNodeEntry entry :
                     beforeTemplate.getChildNodeEntries(store, beforeId)) {
@@ -403,7 +403,7 @@ class Template {
                 String name = beforeCNE.getName();
                 NodeState beforeChild = beforeCNE.getNodeState();
                 NodeState afterChild = getChildNode(name, store, afterId);
-                if (afterChild == null) {
+                if (!afterChild.exists()) {
                     diff.childNodeDeleted(name, beforeChild);
                 } else {
                     baseChildNodes.add(name);



Mime
View raw message