lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guangtai Liang (Created) (JIRA)" <>
Subject [jira] [Created] (LUCENE-3783) An incomplete fix for the NPE bugs in
Date Tue, 14 Feb 2012 14:10:59 GMT
An incomplete fix for the NPE bugs in

                 Key: LUCENE-3783
             Project: Lucene - Java
          Issue Type: Bug
          Components: core/search
    Affects Versions: 3.0
            Reporter: Guangtai Liang

The fix revision 698487 was aimed to remove an NPE bug (LUCENE-1404) on the returned value
 of  "min()" in the method "isPayloadAvailable" of the file "/lucene/java/trunk/src/java/org/apache/lucene/search/spans/"
, but it is incomplete. 

Since the  returned value  "min()" 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: 
Lines 159 , 170 , and 196 of the methods "next()" 
Line 216 of the methods "skipTo()"
Line 230 of the methods "doc()"
230  public int doc() { return min().doc(); }

Line 232 of the methods "start()"
232  public int start() { return min().start(); }

Line 315 of the methods "atMatch()"
	private boolean atMatch() {
315    return (min().doc() == max.doc())
	        && ((max.end() - min().start() - totalLength) <= slop);

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message