Thanks Mark, looks like it should be if (other instanceof BitDocSet).
On Fri, Nov 14, 2008 at 1:58 PM, Mark Miller <[EMAIL PROTECTED]> wrote:
> Maybe for the future? Wondering, because it looks odd at the moment -
> OpenBitSet doesn't extend DocSet, so the if can never be true. Something
> seems odd anyway - or maybe its just waiting for future code changes...
>
> public DocSet andNot(DocSet other) {
> OpenBitSet newbits = (OpenBitSet)(bits.clone());
> if (other instanceof OpenBitSet) {
> newbits.andNot(((BitDocSet)other).bits);
> } else {
> DocIterator iter = other.iterator();
> while (iter.hasNext()) newbits.clear(iter.nextDoc());
> }
> return new BitDocSet(newbits);
> }
>