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

FileInputStream never closed in HTMLParser

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • modules/examples
    • None
    • Operating System: other
      Platform: Other

    • 28187

    Description

      HTMLParser.java contains this code:

      public HTMLParser(File file) throws FileNotFoundException

      { this(new FileInputStream(file)); }

      This FileInputStream should be closed with the close() method, as there's no
      guarantee that the garbage collection will run and do this for you. I don't
      know how to fix this without changing the API to take a FileInputStream
      instead of a File, as the call to this() must be the first thing in the
      constructor, i.e. you cannot create the stream, call this(...), and then close
      the stream.

      Attachments

        Issue Links

          Activity

            People

              java-dev@lucene.apache.org Lucene Developers
              daniel.naber@t-online.de Daniel Naber
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: