logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1582039 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XMLConfiguration.java
Date Wed, 26 Mar 2014 20:30:30 GMT
Author: ggregory
Date: Wed Mar 26 20:30:30 2014
New Revision: 1582039

URL: http://svn.apache.org/r1582039
Log:
Bullet-proofing.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XMLConfiguration.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XMLConfiguration.java?rev=1582039&r1=1582038&r2=1582039&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XMLConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XMLConfiguration.java
Wed Mar 26 20:30:30 2014
@@ -133,8 +133,11 @@ public class XMLConfiguration extends Ab
 
         try {
             final InputStream configStream = configSource.getInputStream();
-            buffer = toByteArray(configStream);
-            configStream.close();
+            try {
+                buffer = toByteArray(configStream);
+            } finally {
+                configStream.close();
+            }
             final InputSource source = new InputSource(new ByteArrayInputStream(buffer));
             final Document document = newDocumentBuilder().parse(source);
             rootElement = document.getDocumentElement();



Mime
View raw message