OpenBitSet hashCode and equals incongruent [LUCENE-5423]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
In org.apache.lucene.util.OpenBitSet the hashCode method might return different hash codes for equal bitsets.
This happens when there are bits set in words right of wlen. This might happen through a getAndSet call (the documentation states that getAndSet may only be called on positions that are smaller than the size - which is the length of the array not wlen - this might be another issue).
---
Migrated from [LUCENE-5423](https://issues.apache.org/jira/browse/LUCENE-5423) by Jakob Zwiener
Contributor guide
Research direction
Start with org.apache.lucene.util.OpenBitSet, reading its hashCode and equals implementations alongside getAndSet and the wlen-related behavior described in the report. Reproduce a case with bits set beyond wlen, then verify that equal bitsets produce equal hash codes and that the relevant behavior is covered by tests.
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