[
https://issues.apache.org/jira/browse/LUCENE-6427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14511100#comment-14511100
]
Luc Vanlerberghe commented on LUCENE-6427:
------------------------------------------
I didn't check if these where valid use cases or not, just that they happen to
be in the code, probably for lack of an easy alternative to call.
While developing custom modules for solr, I took advantage of the existence of
FixedBitSet (it was called OpenBitSet back then), but found the lack of an
isEmpty() method annoying. There must be others like me...
I only added LongBitSet.flip(long) to be able to make it easier to compare the
TestFixedBitSet and TestLongBitSet files side by side (The main reason why I
removed the {{import java.util.BitSet}} from TestLongBitSet as well)
There are plenty of methods in LongBitSet.java that aren't used yet (even
ensureCapacity that was corrected in LUCENE-6409)
Although I agree that oal.util shouldn't become a bag of classes and methods
that *might* be useful one day, aiming to keep LongBitSet and FixedBitSet more
or less in sync (even though by definition they'll never share the same
interface) shouldn't be too hard.
> BitSet fixes - assert on presence of 'ghost bits' and others
> ------------------------------------------------------------
>
> Key: LUCENE-6427
> URL: https://issues.apache.org/jira/browse/LUCENE-6427
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/other
> Reporter: Luc Vanlerberghe
>
> Fixes after reviewing org.apache.lucene.util.FixedBitSet, LongBitSet and
> corresponding tests:
> * Some methods rely on the fact that no bits are set after numBits (what I
> call 'ghost' bits here).
> ** cardinality, nextSetBit, intersects and others may yield wrong results
> ** If ghost bits are present, they may become visible after ensureCapacity is
> called.
> ** The tests deliberately create bitsets with ghost bits, but then do not
> detect these failures
> * FixedBitSet.cardinality scans the complete backing array, even if only
> numWords are in use
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]