Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5511

Missing close call on FileInputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.6.2
    • 1.6.3, 1.7.0
    • kernel
    • None

    Description

      The "prettify(File)" method within "org.apache.axis2.util.XMLPrettyPrinter" creates a FileInputStream but does not close it explicitly. Hence XML files are locked for a while after this feature is being used; the stream is closed implicitly when the FileInputStream instance is garbage collected, but you never now when in time this happens.

      Since this class is used when running the code-generator, which we are using frequently within our application, this results in that we cannot tidy up files after this task has completed.
      Current workaround for us was to implement a custom Emitter and avoid running the XML pretty printing.

      Attachments

        1. streamClose.patch
          2 kB
          Shameera

        Activity

          People

            Unassigned Unassigned
            evi Erik Vikström
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: