lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r788193 - /lucene/java/trunk/src/java/org/apache/lucene/search/Filter.java
Date Wed, 24 Jun 2009 22:04:31 GMT
Author: uschindler
Date: Wed Jun 24 22:04:31 2009
New Revision: 788193

URL: http://svn.apache.org/viewvc?rev=788193&view=rev
Log:
It is better to fail early here. If you incorrectly override e.g. getDocIDSet instead of getDocIdSet(),
you will never find the error, only get NPEs at unrelated positions. Throwing the UOE shows
exactly where to look for the error.
For a similar case see the new DocIdSetIterator.

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/Filter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Filter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Filter.java?rev=788193&r1=788192&r2=788193&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Filter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Filter.java Wed Jun 24 22:04:31 2009
@@ -37,7 +37,7 @@
    * @deprecated Use {@link #getDocIdSet(IndexReader)} instead.
    */
   public BitSet bits(IndexReader reader) throws IOException {
-    return null;
+    throw new UnsupportedOperationException();
   }
 	
   /**



Mime
View raw message