Repository: logging-log4j2
Updated Branches:
  refs/heads/master a85fe0c73 -> 520170c80


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/master
Commit: 520170c80442d51bb347171800576770d5b2b5ce
Parents: a85fe0c
Author: Mikael StÃ¥ldal <[email protected]>
Authored: Sun Aug 21 17:08:43 2016 +0200
Committer: Mikael StÃ¥ldal <[email protected]>
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);

Reply via email to