jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r292713 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java
Date Fri, 30 Sep 2005 12:09:06 GMT
Author: mreutegg
Date: Fri Sep 30 05:09:03 2005
New Revision: 292713

URL: http://svn.apache.org/viewcvs?rev=292713&view=rev
Log:
Performance improvement
- Remove redundant check in prefetchNext(). Most calls to itemExists() will succeed anyway
and the case where the item does not exist is also covered in getItem().

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

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java?rev=292713&r1=292712&r2=292713&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LazyItemIterator.java Fri
Sep 30 05:09:03 2005
@@ -24,6 +24,7 @@
 import javax.jcr.Property;
 import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
+import javax.jcr.ItemNotFoundException;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.ArrayList;
@@ -84,17 +85,14 @@
         next = null;
         while (next == null && pos < idList.size()) {
             ItemId id = (ItemId) idList.get(pos);
-            if (!itemMgr.itemExists(id)) {
+            try {
+                next = itemMgr.getItem(id);
+            } catch (ItemNotFoundException e) {
                 log.debug("ignoring nonexistent item " + id);
                 // remove invalid id
                 idList.remove(pos);
                 // try next
-                continue;
-            }
-            try {
-                next = itemMgr.getItem(id);
             } catch (RepositoryException e) {
-                // should never get here since existence has already been checked...
                 log.error("failed to fetch item " + id + ", skipping...", e);
                 // remove invalid id
                 idList.remove(pos);



Mime
View raw message