commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <ep...@upstate.com>
Subject RE: [configuration] Closing opened input streams
Date Mon, 29 Mar 2004 13:32:57 GMT
We can do that..  Just need to trap and throw the resulting IOException as a
ConfigurationException then...

Eric

> -----Original Message-----
> From: Emmanuel Bourg [mailto:ebourg@micropole-univers.com]
> Sent: Monday, March 29, 2004 10:34 AM
> To: Jakarta Commons Developers List
> Subject: Re: [configuration] Closing opened input streams
>
>
> I just looked at the patch :
>
> --- PropertiesConfiguration.java	28 Mar 2004 14:43:04 -0000 1.5
> +++ PropertiesConfiguration.java	28 Mar 2004 15:34:23 -0000 1.6
> @@ -99,7 +99,9 @@
>       public void load(String fileName) throws ConfigurationException
>       {
>           try {
> -            load(getPropertyStream(fileName));
> +            InputStream is = getPropertyStream(fileName);
> +            load(is);
> +            is.close();
>           }
>
>
> I think the call to the close() method should be in a finally
> block instead.
>
> Emmanuel Bourg
>
>
> Eric Pugh wrote:
> > Hi Stephen,
> >
> > I think I have just resolved the problem!  Thanks for sending it.
> >
> > Eric
> >
> >
> >>-----Original Message-----
> >>From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
> >>Sent: Wednesday, March 17, 2004 9:30 PM
> >>To: Jakarta Commons Developers List
> >>Subject: [configuration] Closing opened input streams
> >>
> >>
> >>A bug was reported against [collections] ExtendedProperties
> >>http://issues.apache.org/bugzilla/show_bug.cgi?id=27737
> >>
> >>I found that the input stream created in the constructor was
> not closed. I
> >>just checked PropertiesConfiguration, and the load() methods
> seem to have
> >>the same problem.
> >>
> >>Stephen
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message