Lucene - Core
  1. Lucene - Core
  2. LUCENE-1686

Remove Unnecessary NULL check in FindSegmentsFile - cleanup

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9, 3.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      FindSegmentsFile accesses the member "directory" in line 579 while performing a null check in 592. The null check is unnecessary as if directory is null line 579 would throw a NPE.
      I removed the null check and made the member "directory" final. In addition I added a null check in the constructor as If the value is null we should catch it asap.

      1. segments_info.patch
        4 kB
        Simon Willnauer

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Simon Willnauer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development