RollingCharBuffer does not check all failed values.
Open
type:bug
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
### Description
The method code is as follows:
' public int get(int pos) throws IOException {
...
final int readCount = reader.read(buffer, nextWrite, toRead);
if (readCount == -1) {
end = true;
return -1;
}
'
When readCount fails, it can return 0. This value should aslo be checked.
https://github.com/apache/lucene/pull/13512
### Version and environment details
_No response_
Contributor guide
Research direction
Start with RollingCharBuffer.get(int pos) and inspect the reader.read call described in the issue. Review pull request 13512 for the related work; done means the method handles a zero readCount as well as -1 while preserving the existing end-of-input behavior.
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
- Clearly specified
- Newbie friendliness
- 30/100