apache / apache/lucene

OpenBitSet should report the configured capacity/size [LUCENE-3281]

Open
#4,354 5 comments 0 reactions 0 assignees View on GitHub
affects-version:3.0 affects-version:3.0.1 affects-version:3.0.2 affects-version:3.0.3 affects-version:3.1 affects-version:3.2 legacy-jira-priority:Minor module:core/other type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

OpenBitSet rounds up the capacity() to the next multiple of 64 from what was specified. However, this is particularly damaging with the new asserts, which trigger when anything above the specified capacity is used as an index. The simple fix is to return numBits for capacity().

---
Migrated from [LUCENE-3281](https://issues.apache.org/jira/browse/LUCENE-3281) by Robert Ragno (@rragno)

Contributor guide

Open the contributing guide

Research direction

Search the Lucene source for OpenBitSet and its capacity() method, then read how numBits and the assertion checks are used. Confirm the configured capacity is reported consistently and run the existing OpenBitSet tests, adding coverage for the reported capacity if the current tests do not exercise it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.