Lucene - Core
  1. Lucene - Core
  2. LUCENE-3780

An incomplete fix for the NPE bugs in ParallelReader.java

    Details

    • Lucene Fields:
      New

      Description

      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/ParallelReader.java
      " , 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 return; }

      if (field != null)
      [Line 499] termEnum = fieldToReader.get(field).terms();
      }

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Guangtai Liang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 10m
              10m
              Remaining:
              Remaining Estimate - 10m
              10m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development