[RFC][Icedtea-web]: Close streams after opening them.
Andrew Su
asu at redhat.com
Mon Mar 7 13:40:36 PST 2011
----- Original Message -----
> From: "Omair Majid" <omajid at redhat.com>
> To: "Andrew Su" <asu at redhat.com>
> Cc: "Denis Lila" <dlila at redhat.com>, "IcedTea" <distro-pkg-dev at openjdk.java.net>
> Sent: Monday, March 7, 2011 4:30:20 PM
> Subject: Re: [RFC][Icedtea-web]: Close streams after opening them.
> On 03/07/2011 04:01 PM, Andrew Su wrote:
> >> Subject: Re: [RFC][Icedtea-web]: Close streams after opening them.
> >>> Questions, comments, concerns?
> >>
> >> Maybe it would be better to put the close() in a "finally" block
> >> after the catch?
> >
> > I don't think that'd be necessary, since if an exception was thrown.
> > The stream won't be open.
> >
>
> store(s, header) can throw an IOException too. I agree with Dennis;
> s.close() should be in a finally block. I also see similar code in
> PropertiesFile.load(): an InputStream is never closed. Can you please
> fix that too?
Haha yeah, I overlooked that. :P
Updated to fix this for load() as well.
Cheers,
Andrew
>
> Cheers,
> Omair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20110307_close_streams_v3.patch
Type: text/x-patch
Size: 1309 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110307/0de229f5/20110307_close_streams_v3.patch
More information about the distro-pkg-dev
mailing list