Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
New
Description
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