jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r719588 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
Date Fri, 21 Nov 2008 14:30:01 GMT
Author: angela
Date: Fri Nov 21 06:30:01 2008
New Revision: 719588

URL: http://svn.apache.org/viewvc?rev=719588&view=rev
Log:
JCR-1870: reloading of invalidated nodes doesn't benefit from batch-read

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java?rev=719588&r1=719587&r2=719588&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
Fri Nov 21 06:30:01 2008
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.jcr2spi.state;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -88,15 +87,9 @@
             throws ItemNotFoundException, RepositoryException {
         // build new node state from server information
         try {
-            NodeState nodeState;
-            if (entry.getStatus() == Status.INVALIDATED) {
-                // simple reload -> don't use batch-read
-                NodeInfo nInfo = service.getNodeInfo(sessionInfo, nodeId);
-                nodeState = createItemStates(nodeId, Collections.singletonList(nInfo).iterator(),
entry, false);
-            } else {
-                Iterator infos = service.getItemInfos(sessionInfo, nodeId);
-                nodeState = createItemStates(nodeId, infos, entry, false);
-            }
+            Iterator infos = service.getItemInfos(sessionInfo, nodeId);
+            NodeState nodeState = createItemStates(nodeId, infos, entry, false);
+
             if (nodeState == null) {
                 throw new ItemNotFoundException("HierarchyEntry does not belong to any existing
ItemInfo.");
             }
@@ -226,14 +219,12 @@
 
         // deal with all additional ItemInfos that may be present.
         NodeEntry parentEntry = nodeState.getNodeEntry();
-        if (parentEntry.getStatus() != Status.INVALIDATED) {
-            while (itemInfos.hasNext()) {
-                ItemInfo info = (ItemInfo) itemInfos.next();
-                if (info.denotesNode()) {
-                    createDeepNodeState((NodeInfo) info, parentEntry, infos);
-                } else {
-                    createDeepPropertyState((PropertyInfo) info, parentEntry, infos);
-                }
+        while (itemInfos.hasNext()) {
+            ItemInfo info = (ItemInfo) itemInfos.next();
+            if (info.denotesNode()) {
+                createDeepNodeState((NodeInfo) info, parentEntry, infos);
+            } else {
+                createDeepPropertyState((PropertyInfo) info, parentEntry, infos);
             }
         }
         return nodeState;



Mime
View raw message