lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Updated] (LUCENE-3179) OpenBitSet.prevSetBit()
Date Fri, 24 Jun 2011 17:41:47 GMT


Uwe Schindler updated LUCENE-3179:

    Attachment: LUCENE-3179-fix.patch

Yonik mentioned on mailing list that prevSetBit is broken for size==0 and also indexes >=
size. In that case you always get AIOOBE or even wrong results. In the case of an index >=
the length of the bitset, the scanning must start at the last possible bit, so subIndex must
be 0x3f and not simply the anded bits.

This is my naive fix. Tests pass (I added a extra check to the test that start beyond end
of bitset to check prevSetBit).

> OpenBitSet.prevSetBit()
> -----------------------
>                 Key: LUCENE-3179
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Paul Elschot
>            Priority: Minor
>             Fix For: 3.3, 4.0
>         Attachments: LUCENE-3179-fix.patch, LUCENE-3179.patch, LUCENE-3179.patch, LUCENE-3179.patch,, TestOpenBitSet.patch
> Find a previous set bit in an OpenBitSet.
> Useful for parent testing in nested document query execution LUCENE-2454 .

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message