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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: Streams/Writers
    • Labels:

      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

            • Assignee:
              garydgregory Gary Gregory
              Reporter:
              fabian.barney Fabian Barney
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: