poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1738848 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
Date Tue, 12 Apr 2016 18:48:31 GMT
Author: onealj
Date: Tue Apr 12 18:48:31 2016
New Revision: 1738848

URL: http://svn.apache.org/viewvc?rev=1738848&view=rev
Log:
bug 59312: delete temporary files even when the output stream cannot be closed (such as out
of disk space IOException)

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java?rev=1738848&r1=1738847&r2=1738848&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java Tue Apr 12
18:48:31 2016
@@ -375,7 +375,12 @@ public class SheetDataWriter {
      * @return true if the file was deleted, false if it wasn't.
      */
     boolean dispose() throws IOException {
-        _out.close();
-        return _fd.delete();
+        final boolean ret;
+        try {
+            _out.close();
+        } finally {
+            ret = _fd.delete();
+        }
+        return ret;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message