Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-303

TeeOutputStream does not call branch.close() when main.close() throws an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.2
    • Streams/Writers

    Description

      TeeOutputStream.close() looks like this:

      TeeOutputStream.java
          /**
           * Closes both streams. 
           * @throws IOException if an I/O error occurs
           */
          @Override
          public void close() throws IOException {
              super.close();
              this.branch.close();
          }
      

      It is obvious that this.branch.close() is not executed when super.close() raises an exception. super.close() may in fact raise an IOException since ProxyOutputStream.handleIOException(IOException) is not overridden.

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            fabian.barney Fabian Barney
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: