apache / apache/lucene

OpenBitSet has a 'assert-only' variable called numBits, which is not always correctly updated [LUCENE-4233]

Open
#5,304 0 comments 0 reactions 0 assignees View on GitHub
affects-version:3.6 affects-version:4.1 legacy-jira-priority:Trivial type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

If I call ensureCapacity the variable numBits is not correctly updated.

numBits is updated if I call the (protected!) method expandingWordNum.

Probably related to #LUCENE-3281

---
Migrated from [LUCENE-4233](https://issues.apache.org/jira/browse/LUCENE-4233) by Peter Karich

Contributor guide

Open the contributing guide

Research direction

Start by locating OpenBitSet and inspect ensureCapacity alongside the protected expandingWordNum method, where the issue says numBits is updated. Confirm the expected numBits value after ensureCapacity and add a regression test covering that call; done means the assert-only variable is updated consistently.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.