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

HunspellDictionary - AffixFile Reader closed, Dictionary Readers left unclosed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6
    • Fix Version/s: 3.6.1, 4.0-BETA, 6.0
    • Component/s: modules/analysis
    • Labels:
      None
    • Environment:

      Linux, Java 1.6

    • Lucene Fields:
      New

      Description

      The HunspellDictionary takes an InputStream for affix file and a List of Streams for dictionaries.

      Javadoc is not clear about i have to close those stream myself or the Dictionary constructor does this already.

      Looking at the code, at least reader.close() is called when the affix file is read via readAffixFile() method (although closing streams is not done in a finally block - so the constructor may fail to do so).
      The readDictionaryFile() method does miss the call to close the reader in contrast to readAffixFile().

      So the question here is - have i have to close the streams myself after instantiating the dictionary?
      Or is the close call only missing for the dictionary streams?
      Either way, please add the close calls in a safe manner or clarify javadoc so i have to do this myself.

        Attachments

        1. lucene_36.patch
          6 kB
          Torsten Krah
        2. LUCENE_4156_36.patch
          8 kB
          Torsten Krah
        3. lucene_trunk.patch
          8 kB
          Torsten Krah
        4. LUCENE-4156-trunk.patch
          10 kB
          Chris Male

          Activity

            People

            • Assignee:
              cmale Chris Male
              Reporter:
              tkrah Torsten Krah
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: