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.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@788193 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-06-24 22:04:31 +00:00
parent db261436cf
commit 8173b9f253
1 changed files with 1 additions and 1 deletions

View File

@ -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();
}
/**