tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 52723] An incomplete fix for the resource leak bugs in
Date Tue, 05 Jun 2012 00:23:34 GMT

--- Comment #6 from Konstantin Kolinko <> ---
(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:
For additional commands, e-mail:

View raw message