commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabian Barney (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IO-303) TeeOutputStream fails executing branch.close() when main.close() raised an exception
Date Fri, 17 Feb 2012 13:53:59 GMT

     [ https://issues.apache.org/jira/browse/IO-303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Fabian Barney updated IO-303:
-----------------------------

    Description: 
TeeOutputStream.close() looks like this:
{code:title=TeeOutputStream.java|borderStyle=solid}
    /**
     * Closes both streams. 
     * @throws IOException if an I/O error occurs
     */
    @Override
    public void close() throws IOException {
        super.close();
        this.branch.close();
    }
{code} 

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.

  was:
TeeOutputStream.close() looks like this:
{code:title=TeeOutputStream.java|borderStyle=solid}
    /**
     * Closes both streams. 
     * @throws IOException if an I/O error occurs
     */
    @Override
    public void close() throws IOException {
        super.close();
        this.branch.close();
    }
{code} 

It is obvious that {{this.branch.close()}} is not executed when {{super.close()}} raises an
exception.

    
> TeeOutputStream fails executing branch.close() when main.close() raised an exception
> ------------------------------------------------------------------------------------
>
>                 Key: IO-303
>                 URL: https://issues.apache.org/jira/browse/IO-303
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.1
>            Reporter: Fabian Barney
>              Labels: close, stream
>
> TeeOutputStream.close() looks like this:
> {code:title=TeeOutputStream.java|borderStyle=solid}
>     /**
>      * Closes both streams. 
>      * @throws IOException if an I/O error occurs
>      */
>     @Override
>     public void close() throws IOException {
>         super.close();
>         this.branch.close();
>     }
> {code} 
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message