You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Mikael Ståldal <mi...@magine.com> on 2016/08/21 10:40:03 UTC

Close Input Stream in Configuration factory?

Is a ConfigurationFactory that uses the InputStream from the
ConfigurationSource supposed to close the stream when done? It seems like
XmlConfigurationFactory, JsonConfigurationFactory and
YamlConfigurationFactory do close the stream.

But PropertiesConfigurationFactory does not. Should it?

Re: Close Input Stream in Configuration factory?

Posted by Remko Popma <re...@gmail.com>.
Sounds like an oversight. I can't think of any reason why closing the InputStream would be correct for some ConfigFactories but incorrect for PropertiesConfigurationFactory.

Closing it should be fine. 

Sent from my iPhone

> On 2016/08/21, at 19:40, Mikael Ståldal <mi...@magine.com> wrote:
> 
> Is a ConfigurationFactory that uses the InputStream from the ConfigurationSource supposed to close the stream when done? It seems like XmlConfigurationFactory, JsonConfigurationFactory and YamlConfigurationFactory do close the stream.
> 
> But PropertiesConfigurationFactory does not. Should it?

Re: Close Input Stream in Configuration factory?

Posted by Ralph Goers <ra...@dslextreme.com>.
Almost certainly.

Sent from my iPad

> On Aug 21, 2016, at 3:40 AM, Mikael Ståldal <mi...@magine.com> wrote:
> 
> Is a ConfigurationFactory that uses the InputStream from the ConfigurationSource supposed to close the stream when done? It seems like XmlConfigurationFactory, JsonConfigurationFactory and YamlConfigurationFactory do close the stream.
> 
> But PropertiesConfigurationFactory does not. Should it?

Re: Close Input Stream in Configuration factory?

Posted by Mikael Ståldal <mi...@magine.com>.
Ok, fixed.

On Aug 21, 2016 12:40 PM, "Mikael Ståldal" <mi...@magine.com>
wrote:

> Is a ConfigurationFactory that uses the InputStream from the
> ConfigurationSource supposed to close the stream when done? It seems like
> XmlConfigurationFactory, JsonConfigurationFactory and
> YamlConfigurationFactory do close the stream.
>
> But PropertiesConfigurationFactory does not. Should it?
>