cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r559361 - /incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
Date Wed, 25 Jul 2007 08:51:42 GMT
Author: ffang
Date: Wed Jul 25 01:51:41 2007
New Revision: 559361

URL: http://svn.apache.org/viewvc?view=rev&rev=559361
Log:
[CXF-847] put CachedOutputStream close into finally block

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java?view=diff&rev=559361&r1=559360&r2=559361
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
Wed Jul 25 01:51:41 2007
@@ -198,10 +198,16 @@
             return;
         }
         loaded.add(input);
-        CachedOutputStream out = new CachedOutputStream();
-        IOUtils.copy(input, out);
-        input.setInputStream(out.getInputStream());
-        out.close();
+        CachedOutputStream out = null;
+        try {
+            out = new CachedOutputStream();
+            IOUtils.copy(input, out);
+            input.setInputStream(out.getInputStream());
+        } finally {
+            if (out != null) {
+                out.close();
+            }
+        }
     }
 
     /**



Mime
View raw message