jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cki...@apache.org
Subject svn commit: r610717 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java main/java/org/apache/jackrabbit/core/query/lucene/hits/Hits.java test/java/org/apache/jackrabbit/core/query/TestAll.java
Date Thu, 10 Jan 2008 08:39:09 GMT
Author: ckiehl
Date: Thu Jan 10 00:39:07 2008
New Revision: 610717

URL: http://svn.apache.org/viewvc?rev=610717&view=rev
Log:
JCR-1302: Patched as suggested. Added test case.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/Hits.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java?rev=610717&r1=610716&r2=610717&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/ArrayHits.java
Thu Jan 10 00:39:07 2008
@@ -87,9 +87,9 @@
             int nextDocValue = hits[i];
             if (nextDocValue >= target) {
                 index = i;
-                break;
+                return next();
             }
         }
-        return next();
+        return -1;
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/Hits.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/Hits.java?rev=610717&r1=610716&r2=610717&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/Hits.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/hits/Hits.java
Thu Jan 10 00:39:07 2008
@@ -38,7 +38,8 @@
     
     /** 
      * Skips to the first match beyond the current whose document number is
-     * greater than or equal to the given target.
+     * greater than or equal to the given target. Returns -1 if there is no
+     * matching document number greater than target.
      */
     int skipTo(int target) throws IOException;
     

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java?rev=610717&r1=610716&r2=610717&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/TestAll.java
Thu Jan 10 00:39:07 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.core.query;
 
+import org.apache.jackrabbit.core.query.lucene.hits.ArrayHitsTest;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -51,7 +53,8 @@
         suite.addTestSuite(FnNameQueryTest.class);
         suite.addTestSuite(PathQueryNodeTest.class);
         suite.addTestSuite(SynonymProviderTest.class);
-
+        suite.addTestSuite(ArrayHitsTest.class);
+        
         // exclude long running tests per default
         //suite.addTestSuite(MassiveRangeTest.class);
         //suite.addTestSuite(ConcurrentQueryTest.class);



Mime
View raw message