Index: contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeFilter.java =================================================================== --- contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeFilter.java (revision 738201) +++ contrib/queries/src/java/org/apache/lucene/search/trie/TrieRangeFilter.java (working copy) @@ -27,7 +27,6 @@ import org.apache.lucene.index.TermEnum; import org.apache.lucene.index.Term; import org.apache.lucene.util.OpenBitSet; -import org.apache.lucene.util.SortedVIntList; /** * Implementation of a Lucene {@link Filter} that implements trie-based range filtering. @@ -261,7 +260,7 @@ if (min.compareTo(max) > 0) { // shortcut: if min>max, no docs will match! lastNumberOfTerms=0; - return EMPTY_DOCIDSET; + return DocIdSet.EMPTY_DOCIDSET; } else { final OpenBitSet bits = new OpenBitSet(reader.maxDoc()); final TermDocs termDocs = reader.termDocs(); @@ -295,6 +294,4 @@ private final boolean minInclusive,maxInclusive; private Object minUnconverted,maxUnconverted; private int lastNumberOfTerms=-1; - - private static final DocIdSet EMPTY_DOCIDSET = new SortedVIntList(new int[0]); } Index: src/java/org/apache/lucene/search/DocIdSet.java =================================================================== --- src/java/org/apache/lucene/search/DocIdSet.java (revision 738201) +++ src/java/org/apache/lucene/search/DocIdSet.java (working copy) @@ -18,11 +18,18 @@ */ import java.io.IOException; +import org.apache.lucene.util.SortedVIntList; /** - * A DocIdSet contains a set of doc ids. Implementing classes must provide - * a {@link DocIdSetIterator} to access the set. + * A DocIdSet contains a set of doc ids. Implementing classes must + * only implement {@link #iterator} to provide access to the set. */ public abstract class DocIdSet { - public abstract DocIdSetIterator iterator() throws IOException; + + /** An empty {@code DocIdSet} instance for easy use (this is currently + * implemented using a {@link SortedVIntList}). */ + public static final DocIdSet EMPTY_DOCIDSET = new SortedVIntList(new int[0]); + + /** Provides a {@link DocIdSetIterator} to access the set. */ + public abstract DocIdSetIterator iterator() throws IOException; }