From: "B. K. Oxley (binkley)" <[EMAIL PROTECTED]>
I do not understand. What is being copied in the finally block? Should that have been:

    finally {
        IOUtils.closeQuietly(in);
        IOUtils.closeQuietly(out);
    }
Oops ;-) Yes

I do not want to swallow exceptions thrown by closing in or out as they might indicate to the caller some kind of important failure (say a network error). That is why my original has nexted try/finally blocks:

    finally {
        try {
            out.close();
        } finally {
            in.close();
        }
    }
Oh. This is quite dangerous code as if both the closing of out and in throw an exception only the exception from in is actually thrown.

The question then becomes whether the method to add to IOUtils is copyAndClose() or copyAndCloseQuietly()

I wonder if any other committer has a view.

Were you interested in writing the patch and tests for IOUtils?

Do I just pull IO from SVN? What form of patch: unified diff ok?
Yes x2, but wait until we see if someone else comments on the thread....

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to