camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r892591 - /camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
Date Sun, 20 Dec 2009 13:39:23 GMT
Author: davsclaus
Date: Sun Dec 20 13:39:23 2009
New Revision: 892591

URL: http://svn.apache.org/viewvc?rev=892591&view=rev
Log:
CAMEL-2306: Fixed a problem with not closing a input stream in a converter

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java?rev=892591&r1=892590&r2=892591&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java Sun Dec
20 13:39:23 2009
@@ -202,7 +202,12 @@
 
     @Converter
     public static String toString(URL url, Exchange exchange) throws IOException {
-        return toString(toInputStream(url), exchange);
+        InputStream is = toInputStream(url);
+        try {
+            return toString(is, exchange);
+        } finally {
+            ObjectHelper.close(is, "url", LOG);
+        }
     }
 
     @Converter



Mime
View raw message