You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2016/08/21 15:10:23 UTC
[4/5] logging-log4j2 git commit: Close configuration source input
stream
Close configuration source input stream
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/520170c8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/520170c8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/520170c8
Branch: refs/heads/LOG4J2-1528
Commit: 520170c80442d51bb347171800576770d5b2b5ce
Parents: a85fe0c
Author: Mikael St�ldal <mi...@staldal.nu>
Authored: Sun Aug 21 17:08:43 2016 +0200
Committer: Mikael St�ldal <mi...@staldal.nu>
Committed: Sun Aug 21 17:08:43 2016 +0200
----------------------------------------------------------------------
.../core/config/properties/PropertiesConfigurationFactory.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/520170c8/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory.java
index 8eda63a..1098e8f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationFactory.java
@@ -42,9 +42,8 @@ public class PropertiesConfigurationFactory extends ConfigurationFactory {
@Override
public PropertiesConfiguration getConfiguration(final ConfigurationSource source) {
- final InputStream configStream = source.getInputStream();
final Properties properties = new Properties();
- try {
+ try (final InputStream configStream = source.getInputStream()) {
properties.load(configStream);
} catch (final IOException ioe) {
throw new ConfigurationException("Unable to load " + source.toString(), ioe);