Lucene - Core
  1. Lucene - Core
  2. LUCENE-6608

Potential resource leak in BigramDictionary.java

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: None
    • Component/s: modules/analysis
    • Labels:
    • Lucene Fields:
      New, Patch Available

      Description

      The input and output object streams are being closed in the try block. These resources will not be closed if an exception occurs in the try block

      We can use the finally block to explicitly close these resources or use the new try-with-resources construct where they are implicitly closed.

        Activity

        Hide
        ASF GitHub Bot added a comment -

        GitHub user rmp91 opened a pull request:

        https://github.com/apache/lucene-solr/pull/161

        LUCENE-6608: solved potential resource leakage

        https://issues.apache.org/jira/browse/LUCENE-6608

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/rmp91/lucene-solr LUCENE-6608

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/lucene-solr/pull/161.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #161


        commit 2f9abc607d083a3e1dee95b3d715ffce05839415
        Author: Rishabh Patel <rishabh.mahendra.patel@gmail.com>
        Date: 2015-06-25T19:32:59Z

        solved potential resource leakage


        Show
        ASF GitHub Bot added a comment - GitHub user rmp91 opened a pull request: https://github.com/apache/lucene-solr/pull/161 LUCENE-6608 : solved potential resource leakage https://issues.apache.org/jira/browse/LUCENE-6608 You can merge this pull request into a Git repository by running: $ git pull https://github.com/rmp91/lucene-solr LUCENE-6608 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/161.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #161 commit 2f9abc607d083a3e1dee95b3d715ffce05839415 Author: Rishabh Patel <rishabh.mahendra.patel@gmail.com> Date: 2015-06-25T19:32:59Z solved potential resource leakage
        Hide
        Uwe Schindler added a comment -

        Hi thanks for reporting this. I will take care of this issue!

        Show
        Uwe Schindler added a comment - Hi thanks for reporting this. I will take care of this issue!
        Hide
        ASF subversion and git services added a comment -

        Commit 1687624 from Uwe Schindler in branch 'dev/trunk'
        [ https://svn.apache.org/r1687624 ]

        LUCENE-6608: Fix potential resource leak in BigramDictionary

        Show
        ASF subversion and git services added a comment - Commit 1687624 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1687624 ] LUCENE-6608 : Fix potential resource leak in BigramDictionary
        Hide
        ASF subversion and git services added a comment -

        Commit 1687626 from Uwe Schindler in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1687626 ]

        Merged revision(s) 1687624 from lucene/dev/trunk:
        LUCENE-6608: Fix potential resource leak in BigramDictionary

        Show
        ASF subversion and git services added a comment - Commit 1687626 from Uwe Schindler in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1687626 ] Merged revision(s) 1687624 from lucene/dev/trunk: LUCENE-6608 : Fix potential resource leak in BigramDictionary
        Hide
        Uwe Schindler added a comment -

        Thanks, I just committed this. In addition, I removed the empty catch block which was also suppressing Exceptions on storing.

        Show
        Uwe Schindler added a comment - Thanks, I just committed this. In addition, I removed the empty catch block which was also suppressing Exceptions on storing.
        Hide
        Rishabh Patel added a comment -

        Hi. Thanks for accepting my first patch to Lucene!

        Show
        Rishabh Patel added a comment - Hi. Thanks for accepting my first patch to Lucene!

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Rishabh Patel
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development