jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1507190 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ItemManager.java ItemManagerImpl.java LazyItemIterator.java
Date Fri, 26 Jul 2013 04:45:31 GMT
Author: chetanm
Date: Fri Jul 26 04:45:31 2013
New Revision: 1507190

URL: http://svn.apache.org/r1507190
Log:
JCR-3629 - [jcr2spi]RepositoryException lost in o.a.j.jcr2spi.ItemManagerImpl while querying
on remote nodes

-- Changed the logic to propagate the RepositoryException 
-- Adapted the logic in LazyItemIterator#skip to handle the checked RepositoryException

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java?rev=1507190&r1=1507189&r2=1507190&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
Fri Jul 26 04:45:31 2013
@@ -63,24 +63,27 @@ public interface ItemManager {
      *
      * @param path path to the node to be checked
      * @return true if the specified item exists
+     * @throws RepositoryException
      */
-    public boolean nodeExists(Path path);
+    public boolean nodeExists(Path path) throws RepositoryException;
 
     /**
      * Checks if the property with the given path exists.
      *
      * @param path path to the property to be checked
      * @return true if the specified item exists
+     * @throws RepositoryException
      */
-    public boolean propertyExists(Path path);
+    public boolean propertyExists(Path path) throws RepositoryException;
 
     /**
      * Checks if the item for given HierarchyEntry exists.
      *
      * @param hierarchyEntry
      * @return true if the specified item exists
+      @throws RepositoryException
      */
-    public boolean itemExists(HierarchyEntry hierarchyEntry);
+    public boolean itemExists(HierarchyEntry hierarchyEntry) throws RepositoryException;
 
     /**
      *

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?rev=1507190&r1=1507189&r2=1507190&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
Fri Jul 26 04:45:31 2013
@@ -102,7 +102,7 @@ public class ItemManagerImpl implements 
     /**
      * @see ItemManager#nodeExists(Path)
      */
-    public boolean nodeExists(Path path) {
+    public boolean nodeExists(Path path) throws RepositoryException {
         try {
             // session-sanity & permissions are checked upon itemExists(ItemState)
             NodeState nodeState = hierMgr.getNodeState(path);
@@ -111,15 +111,13 @@ public class ItemManagerImpl implements 
             return false;
         } catch (ItemNotFoundException infe) {
             return false;
-        } catch (RepositoryException re) {
-            return false;
         }
     }
 
     /**
      * @see ItemManager#propertyExists(Path)
      */
-    public boolean propertyExists(Path path) {
+    public boolean propertyExists(Path path) throws RepositoryException {
         try {
             // session-sanity & permissions are checked upon itemExists(ItemState)
             PropertyState propState = hierMgr.getPropertyState(path);
@@ -128,23 +126,19 @@ public class ItemManagerImpl implements 
             return false;
         } catch (ItemNotFoundException infe) {
             return false;
-        } catch (RepositoryException re) {
-            return false;
         }
     }
 
     /**
      * @see ItemManager#itemExists(HierarchyEntry)
      */
-    public boolean itemExists(HierarchyEntry hierarchyEntry) {
+    public boolean itemExists(HierarchyEntry hierarchyEntry) throws RepositoryException {
         try {
             // session-sanity & permissions are checked upon itemExists(ItemState)
             ItemState state = hierarchyEntry.getItemState();
             return itemExists(state);
         } catch (ItemNotFoundException e) {
             return false;
-        } catch (RepositoryException e) {
-            return false;
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java?rev=1507190&r1=1507189&r2=1507190&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
Fri Jul 26 04:45:31 2013
@@ -219,9 +219,17 @@ public class LazyItemIterator implements
             pos++;
             HierarchyEntry entry = iter.next();
             // check if item exists but don't build Item instance.
-            while (!itemMgr.itemExists(entry)) {
-                log.debug("Ignoring nonexistent item " + entry);
-                entry = iter.next();
+            boolean itemExists = false;
+            while(!itemExists){
+                try{
+                    itemExists = itemMgr.itemExists(entry);
+                }catch(RepositoryException e){
+                    log.warn("Failed to check that item {} exists",entry,e);
+                }
+                if(!itemExists){
+                    log.debug("Ignoring nonexistent item {}", entry);
+                    entry = iter.next();
+                }
             }
         }
         // fetch final item (the one to be returned on next())



Mime
View raw message