You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by dp...@apache.org on 2005/06/22 11:27:06 UTC

svn commit: r191785 - in /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: CachingHierarchyManager.java NodeImpl.java

Author: dpfister
Date: Wed Jun 22 02:27:02 2005
New Revision: 191785

URL: http://svn.apache.org/viewcvs?rev=191785&view=rev
Log:
CachingHierarchyManager logs a lot of (harmless) warnings when order of removal notifications is parent first

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?rev=191785&r1=191784&r2=191785&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/CachingHierarchyManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/CachingHierarchyManager.java Wed Jun 22 02:27:02 2005
@@ -323,7 +323,8 @@
             Path path = Path.create(getPath(state.getId()), name, index, true);
             insert(path, new NodeId(uuid));
         } catch (PathNotFoundException e) {
-            log.warn("Added node does not have parent, ignoring event.");
+            log.warn("Unable to get path of node " + state.getId() +
+                    ", event ignored.");
         } catch (MalformedPathException e) {
             log.warn("Unable to create path of " + uuid, e);
         } catch (ItemNotFoundException e) {
@@ -368,7 +369,8 @@
             Path path = Path.create(getPath(state.getId()), name, index, true);
             remove(path, new NodeId(uuid));
         } catch (PathNotFoundException e) {
-            log.warn("Added node does not have parent, ignoring event.");
+            log.warn("Unable to get path of node " + state.getId() +
+                    ", event ignored.");
         } catch (MalformedPathException e) {
             log.warn("Unable to create path of " + uuid, e);
         } catch (ItemNotFoundException e) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=191785&r1=191784&r2=191785&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Wed Jun 22 02:27:02 2005
@@ -598,6 +598,11 @@
             throw new RepositoryException(msg);
         }
 
+        // notify target of removal
+        NodeId childId = new NodeId(entry.getUUID());
+        NodeImpl childNode = (NodeImpl) itemMgr.getItem(childId);
+        childNode.onRemove();
+
         // remove the child node entry
         if (!thisState.removeChildNodeEntry(nodeName, index)) {
             String msg = "failed to remove child " + nodeName + " of "
@@ -605,11 +610,6 @@
             log.debug(msg);
             throw new RepositoryException(msg);
         }
-
-        // notify target of removal
-        NodeId childId = new NodeId(entry.getUUID());
-        NodeImpl childNode = (NodeImpl) itemMgr.getItem(childId);
-        childNode.onRemove();
     }
 
     protected void onRedefine(NodeDefId defId) throws RepositoryException {
@@ -633,12 +633,13 @@
         for (int i = tmp.size() - 1; i >= 0; i--) {
             NodeState.ChildNodeEntry entry =
                     (NodeState.ChildNodeEntry) tmp.get(i);
-            // remove the child node entry
-            thisState.removeChildNodeEntry(entry.getName(), entry.getIndex());
             // recursively remove child node
             NodeId childId = new NodeId(entry.getUUID());
             NodeImpl childNode = (NodeImpl) itemMgr.getItem(childId);
             childNode.onRemove();
+
+            // remove the child node entry
+            thisState.removeChildNodeEntry(entry.getName(), entry.getIndex());
         }
 
         // remove properties