lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r798087 - /lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
Date Mon, 27 Jul 2009 09:52:18 GMT
Author: mikemccand
Date: Mon Jul 27 09:52:17 2009
New Revision: 798087

URL: http://svn.apache.org/viewvc?rev=798087&view=rev
Log:
LUCENE-1754: update back-compat test

Modified:
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java?rev=798087&r1=798086&r2=798087&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
Mon Jul 27 09:52:17 2009
@@ -146,7 +146,9 @@
 
       final Weight w = q.weight(s);
       final Scorer scorer = w.scorer(s.getIndexReader());
-      
+      if (scorer == null) {
+        continue;
+      }
       // FUTURE: ensure scorer.doc()==-1
 
       final int[] sdoc = new int[] {-1};
@@ -219,8 +221,10 @@
     });
     Weight w = q.weight(s);
     Scorer scorer = w.scorer(s.getIndexReader());
-    boolean more = scorer.skipTo(lastDoc[0]+1);
-    if (more) 
-      TestCase.assertFalse("query's last doc was "+lastDoc[0]+" but skipTo("+(lastDoc[0]+1)+")
got to "+scorer.doc(),more);
+    if (scorer != null) {
+      boolean more = scorer.skipTo(lastDoc[0]+1);
+      if (more) 
+        TestCase.assertFalse("query's last doc was "+lastDoc[0]+" but skipTo("+(lastDoc[0]+1)+")
got to "+scorer.doc(),more);
+    }
   }
 }



Mime
View raw message