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-3780) An incomplete fix for the NPE bugs in
Date Tue, 14 Feb 2012 12:56:59 GMT
An incomplete fix for the NPE bugs in

                 Key: LUCENE-3780
             Project: Lucene - Java
          Issue Type: Bug
          Components: core/index
    Affects Versions: 3.0
            Reporter: Guangtai Liang
            Priority: Critical

The fix revision 407851 was aimed to remove an NPE bug on the  return value of  "fieldToReader.get(field)"
in the methods "getTermFreqVector", "hasNorms", "norms", "doSetNorm" of the file "/lucene/java/trunk/src/java/org/apache/lucene/index/
" , but it is incomplete. 
Since the returned value  "fieldToReader.get(field)" 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 499  of the method "ParallelTermEnum()" : 

public ParallelTermEnum() throws IOException {
      try {
        field = fieldToReader.firstKey();
      } catch(NoSuchElementException e) {
        // No fields, so keep field == null, termEnum == null
      if (field != null)
[Line 499]        termEnum = fieldToReader.get(field).terms();

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