jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r639218 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
Date Thu, 20 Mar 2008 09:19:12 GMT
Author: mreutegg
Date: Thu Mar 20 02:19:10 2008
New Revision: 639218

URL: http://svn.apache.org/viewvc?rev=639218&view=rev
Log:
JCR-1488: Node deleted while query is executed should not affect result size

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java?rev=639218&r1=639217&r2=639218&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
Thu Mar 20 02:19:10 2008
@@ -300,14 +300,9 @@
                  sn != null && resultNodes.size() < maxResultSize;
                  sn = result.nextScoreNodes()) {
                 // check access
-                try {
-                    if (isAccessGranted(sn)) {
-                        resultNodes.add(sn);
-                    } else {
-                        invalid++;
-                    }
-                } catch (ItemNotFoundException e) {
-                    // has been deleted meanwhile
+                if (isAccessGranted(sn)) {
+                    resultNodes.add(sn);
+                } else {
                     invalid++;
                 }
             }
@@ -336,17 +331,19 @@
      * @param nodes the nodes to check.
      * @return <code>true</code> if read access is granted to all
      *         <code>nodes</code>.
-     * @throws ItemNotFoundException if one of the <code>nodes</code> is not
-     *                               found.
-     * @throws RepositoryException   if an error occurs while checking access
-     *                               rights.
+     * @throws RepositoryException if an error occurs while checking access
+     *                             rights.
      */
     private boolean isAccessGranted(ScoreNode[] nodes)
-            throws ItemNotFoundException, RepositoryException {
+            throws RepositoryException {
         for (int i = 0; i < nodes.length; i++) {
-            if (nodes[i] != null && !accessMgr.isGranted(
-                    nodes[i].getNodeId(), AccessManager.READ)) {
-                return false;
+            try {
+                if (nodes[i] != null && !accessMgr.isGranted(
+                        nodes[i].getNodeId(), AccessManager.READ)) {
+                    return false;
+                }
+            } catch (ItemNotFoundException e) {
+                // node deleted while query was executed
             }
         }
         return true;



Mime
View raw message