apache / apache/lucene

Another incomplete fix for the NPE bugs in ParallelReader.java [LUCENE-3781]

Open
#4,854 0 comments 0 reactions 0 assignees View on GitHub
affects-version:3.0 legacy-jira-label:incomplete_fix legacy-jira-label:missing_fixes legacy-jira-priority:Major module:core/index type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The fix revision 407851 was aimed to remove an NPE bug ("fix NPE and deletion bugs in ParallelReader: LUCENE-561") on the value of "termDocs" in the methods "next", "read", "skipTo", "close" of the file "/lucene/java/trunk/src/java/org/apache/lucene/index/ParallelReader.java
" , but it is incomplete.
Since the value "termDocs" could be null during the runtime execution, its value should also be null-checked before being dereferenced in other methods.

The buggy code locations the same fix needs to be applied at are as bellows:

Line 574, 575 of the methods "doc()" , and "freq":

public int doc() { return termDocs.doc(); }
public int freq() { return termDocs.freq(); }

---
Migrated from [LUCENE-3781](https://issues.apache.org/jira/browse/LUCENE-3781) by Guangtai Liang

Contributor guide

Open the contributing guide

Research direction

Start by locating lucene/java/trunk/src/java/org/apache/lucene/index/ParallelReader.java and checking whether this historical path still exists. Inspect the doc() and freq() methods around lines 574-575 and compare them with the existing termDocs handling in next, read, skipTo, and close; done means those methods safely handle a null termDocs value.

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
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.