Lucene - Core
  1. Lucene - Core
  2. LUCENE-6696

FilterDirectoryReader.doClose() should call in.close() not in.doClose()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      FilterDirectoryReader.doClose() calls in.doClose(). This is wrong because if you call close() on both the underlying reader and a wrapper around it, then doClose() will have been called several times, which will break ref counting.

      Instead, FilterDirectoryReader.doClose() should call in.close() so that it is a no-op if the underlying reader is already closed, or so that calling close() on the underlying reader afterwards will be a no-op.

        Activity

        Hide
        Adrien Grand added a comment -

        Here is a patch.

        Show
        Adrien Grand added a comment - Here is a patch.
        Hide
        Robert Muir added a comment -

        +1

        Show
        Robert Muir added a comment - +1
        Hide
        ASF subversion and git services added a comment -

        Commit 1692505 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1692505 ]

        LUCENE-6696: Fix FilterDirectoryReader.doClose to call in.close() instead of in.doClose().

        Show
        ASF subversion and git services added a comment - Commit 1692505 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1692505 ] LUCENE-6696 : Fix FilterDirectoryReader.doClose to call in.close() instead of in.doClose().
        Hide
        ASF subversion and git services added a comment -

        Commit 1692512 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1692512 ]

        LUCENE-6696: Fix FilterDirectoryReader.doClose to call in.close() instead of in.doClose().

        Show
        ASF subversion and git services added a comment - Commit 1692512 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1692512 ] LUCENE-6696 : Fix FilterDirectoryReader.doClose to call in.close() instead of in.doClose().
        Hide
        ASF subversion and git services added a comment -

        Commit 1692533 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1692533 ]

        LUCENE-6696: Don't use the forbidden API Collections.shuffle(List).

        Show
        ASF subversion and git services added a comment - Commit 1692533 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1692533 ] LUCENE-6696 : Don't use the forbidden API Collections.shuffle(List).
        Hide
        ASF subversion and git services added a comment -

        Commit 1692535 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1692535 ]

        LUCENE-6696: Don't use the forbidden API Collections.shuffle(List).

        Show
        ASF subversion and git services added a comment - Commit 1692535 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1692535 ] LUCENE-6696 : Don't use the forbidden API Collections.shuffle(List).
        Hide
        Shalin Shekhar Mangar added a comment -

        Bulk close for 5.3.0 release

        Show
        Shalin Shekhar Mangar added a comment - Bulk close for 5.3.0 release

          People

          • Assignee:
            Adrien Grand
            Reporter:
            Adrien Grand
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development