Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

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.

Uwe Schindler8173b9f253e9
diff --git a/src/java/org/apache/lucene/search/Filter.java b/src/java/org/apache/lucene/search/Filter.java
index 25cffcf8db5..4e0df738823 100644
--- a/src/java/org/apache/lucene/search/Filter.java
+++ b/src/java/org/apache/lucene/search/Filter.java
@@ -37,7 +37,7 @@ public abstract class Filter implements java.io.Serializable {
* @deprecated Use {@link #getDocIdSet(IndexReader)} instead.
*/
public BitSet bits(IndexReader reader) throws IOException {
- return null;
+ throw new UnsupportedOperationException();
}
/**