commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1632051 - /commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/AbstractDataSourceResolverTest.java
Date Wed, 15 Oct 2014 14:12:16 GMT
Author: ggregory
Date: Wed Oct 15 14:12:16 2014
New Revision: 1632051

URL: http://svn.apache.org/r1632051
Log:
Makes sure the stream is closed.

Modified:
    commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/AbstractDataSourceResolverTest.java

Modified: commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/AbstractDataSourceResolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/AbstractDataSourceResolverTest.java?rev=1632051&r1=1632050&r2=1632051&view=diff
==============================================================================
--- commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/AbstractDataSourceResolverTest.java
(original)
+++ commons/proper/email/trunk/src/test/java/org/apache/commons/mail/resolver/AbstractDataSourceResolverTest.java
Wed Oct 15 14:12:16 2014
@@ -31,8 +31,12 @@ public abstract class AbstractDataSource
     {
         if(dataSource != null)
         {
-            final InputStream is = dataSource.getInputStream();
-            return IOUtils.toByteArray(is);
+            InputStream is = dataSource.getInputStream();
+            try {
+                return IOUtils.toByteArray(is);
+            } finally {
+                is.close();
+            }
         }
         return null;
     }



Mime
View raw message