cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1362484 - /cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
Date Tue, 17 Jul 2012 13:31:27 GMT
Author: dkulp
Date: Tue Jul 17 13:31:27 2012
New Revision: 1362484

URL: http://svn.apache.org/viewvc?rev=1362484&view=rev
Log:
[CXF-4356] Make sure close isn't called twice, thus wiping out the temp
file prematurely

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java?rev=1362484&r1=1362483&r2=1362484&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java Tue Jul 17 13:31:27
2012
@@ -464,9 +464,13 @@ public class CachedOutputStream extends 
         } else {
             try {
                 FileInputStream fileInputStream = new FileInputStream(tempFile) {
+                    boolean closed;
                     public void close() throws IOException {
-                        super.close();
-                        maybeDeleteTempFile(this);
+                        if (!closed) {
+                            super.close();
+                            maybeDeleteTempFile(this);
+                        }
+                        closed = true;
                     }
                 };
                 streamList.add(fileInputStream);



Mime
View raw message