lucene-dev mailing list archives

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

     [ https://issues.apache.org/jira/browse/LUCENE-3179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

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: https://issues.apache.org/jira/browse/LUCENE-3179
>             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,
TestBitUtil.java, 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: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message