jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1148390 - /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/ItemInfos.java
Date Tue, 19 Jul 2011 15:17:46 GMT
Author: mduerig
Date: Tue Jul 19 15:17:46 2011
New Revision: 1148390

URL: http://svn.apache.org/viewvc?rev=1148390&view=rev
Log:
spi2microkernel (WIP)
- fix batch reading

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/ItemInfos.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/ItemInfos.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/ItemInfos.java?rev=1148390&r1=1148389&r2=1148390&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/ItemInfos.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/ItemInfos.java
Tue Jul 19 15:17:46 2011
@@ -54,7 +54,10 @@ public final class ItemInfos {
 
         InfoListener infoListener = new InfoListener() {
             public void createNodeInfo(NodeInfo nodeInfo) {
-                itemInfos.addFirst(nodeInfo);
+                if (nodeInfo.getChildInfos() != null) {
+                    // null child node infos indicate an empty node. Do not include!
+                    itemInfos.addFirst(nodeInfo);
+                }
             }
 
             public void createChildInfos(NodeId id, Iterator<ChildInfo> childInfos)
{}
@@ -198,10 +201,8 @@ public final class ItemInfos {
         @Override
         public boolean endObject() throws ParseException, IOException {
             try {
-                nodeInfoBuilder = isObjectEmpty
-                    ? nodeInfoBuilder.getParent()
-                    : nodeInfoBuilder.build();
-
+                nodeInfoBuilder.includeChildInfos(!isObjectEmpty);
+                nodeInfoBuilder = nodeInfoBuilder.build();
                 isObjectEmpty = false;
                 return !infoListener.done();
             }



Mime
View raw message