jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r488395 - /jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Date Mon, 18 Dec 2006 19:19:47 GMT
Author: jukka
Date: Mon Dec 18 11:19:46 2006
New Revision: 488395

URL: http://svn.apache.org/viewvc?view=rev&rev=488395
Log:
1.2: Merged revision 488325 (JCR-682)

Modified:
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?view=diff&rev=488395&r1=488394&r2=488395
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
(original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Mon Dec 18 11:19:46 2006
@@ -374,14 +374,22 @@
     /**
      * {@inheritDoc}
      * <p/>
-     * Generate subsequent add and remove notifications for every replacement.
+     * Generate subsequent add and remove notifications for every replacement. This method
+     * currently assumes that the reordering is detectable by comparing the state's child
+     * node entries to the overlayed state's child node entries. It is not able to handle
+     * a transient reordering and will therefore evict its cached entry if such a situation
+     * is detected.
      */
     public void nodesReplaced(NodeState state) {
         List entries = state.getReorderedChildNodeEntries();
         if (entries.size() == 0) {
+            synchronized (cacheMonitor) {
+                if (idCache.containsKey(state.getNodeId())) {
+                    evict(state.getNodeId());
+                }
+            }
             return;
         }
-
         Iterator iter = entries.iterator();
         while (iter.hasNext()) {
             NodeState.ChildNodeEntry now = (NodeState.ChildNodeEntry) iter.next();
@@ -806,6 +814,13 @@
          */
         public PathMap.Element getElement() {
             return element;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public String toString() {
+            return id.toString();
         }
     }
 }



Mime
View raw message