jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1143738 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.java
Date Thu, 07 Jul 2011 09:54:06 GMT
Author: mreutegg
Date: Thu Jul  7 09:54:06 2011
New Revision: 1143738

URL: http://svn.apache.org/viewvc?rev=1143738&view=rev
Log:
JCR-3015: EntryCollector may log warning for inexistent item

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.java?rev=1143738&r1=1143737&r2=1143738&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.java
Thu Jul  7 09:54:06 2011
@@ -27,6 +27,7 @@ import org.apache.jackrabbit.util.Text;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -299,7 +300,7 @@ public class EntryCollector extends Acce
         }
 
         private void siftNodeAdded(String identifier) throws RepositoryException {
-            if (session.nodeExists(getIdentifierPath(identifier))) {
+            try {
                 NodeImpl n = (NodeImpl) session.getNodeByIdentifier(identifier);
                 if (n.isNodeType(EntryCollector.NT_REP_ACL)) {
                     // a new ACL was added -> use the added node to update
@@ -315,7 +316,7 @@ public class EntryCollector extends Acce
                             AccessControlObserver.POLICY_MODIFIED);
                 } /* else: some other node added below an access controlled
                      parent node -> not interested. */
-            } else {
+            } catch (ItemNotFoundException e) {
                 log.debug("Cannot process NODE_ADDED event. Node {} doesn't exist (anymore).",
identifier);
             }
         }
@@ -347,7 +348,7 @@ public class EntryCollector extends Acce
         }
 
         private void siftPropertyChanged(String identifier) throws RepositoryException {
-            if (session.nodeExists(getIdentifierPath(identifier))) {
+            try {
                 // test if the changed prop belongs to an ACE
                 NodeImpl parent = (NodeImpl) session.getNodeByIdentifier(identifier);
                 if (parent.isNodeType(EntryCollector.NT_REP_ACE)) {
@@ -357,7 +358,7 @@ public class EntryCollector extends Acce
                 } /* some other property below an access controlled node
                  changed -> not interested. (NOTE: rep:ACL doesn't
                  define any properties. */
-            } else {
+            } catch (ItemNotFoundException e) {
                 log.debug("Cannot process PROPERTY_CHANGED event. Node {} doesn't exist (anymore).",
identifier);
             }
         }
@@ -377,11 +378,5 @@ public class EntryCollector extends Acce
             }
             modMap.put(accessControllNodeId, modType);
         }
-
-        private static String getIdentifierPath(String identifier) {
-            StringBuilder sb = new StringBuilder();
-            sb.append('[').append(identifier).append(']');
-            return sb.toString();
-        }
     }
 }
\ No newline at end of file



Mime
View raw message