Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3464

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.5, 4.0-ALPHA
    • None
    • None
    • 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.

      Attachments

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

        Activity

          People

            mikemccand Michael McCandless
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: