https://issues.apache.org/bugzilla/show_bug.cgi?id=52723

--- Comment #6 from Konstantin Kolinko <knst.koli...@gmail.com> ---
(In reply to comment #5)
1. BufferedOutputStream does not deserve closing, because it is in memory only.
No native resources are leaking.

- ObjectOutputStream would never need to be closed. If an IOException happens 
oos will be null as assignment never happens.

- The only one that really has to be closed is FileOutputStream.

- The only situation when FileOutputStream is not-null and needs to be closed
is when its constructor succeeded, but constructors of other streams failed.

2. The only one of other constructors that can (in theory) fail with
IOException is ObjectOutputStream.

It completes with IOException iff call to
ObjectOutputStream#writeStreamHeader() throws an IOException.

My Comment 4 was caused by this point "2.".

Actually, looking further, the writeStreamHeader() method writes 4 bytes. As
those 4 bytes are cached in BufferedOutputStream, an IOException cannot really
happen there.

So sorry for the noise. It is not worth for 6.0.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to