Lucene - Core
  1. Lucene - Core
  2. LUCENE-3464

Rename IndexReader.reopen to make it clear that reopen may not happen

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Spinoff from LUCENE-3454 where Shai noted this inconsistency.

      IR.reopen sounds like an unconditional operation, which has trapped users in the past into always closing the old reader instead of only closing it if the returned reader is new.

      I think this hidden maybe-ness is trappy and we should rename it (maybeReopen? reopenIfNeeded?).

      In addition, instead of returning "this" when the reopen didn't happen, I think we should return null to enforce proper usage of the maybe-ness of this API.

      1. LUCENE-3464.patch
        51 kB
        Michael McCandless
      2. LUCENE-3464.patch
        60 kB
        Michael McCandless
      3. LUCENE-3464.3x.patch
        58 kB
        Michael McCandless
      4. LUCENE-3464_see_its_just_fine.patch
        2 kB
        Robert Muir

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development