poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1055379 - /poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
Date Wed, 05 Jan 2011 09:42:00 GMT
Author: nick
Date: Wed Jan  5 09:42:00 2011
New Revision: 1055379

URL: http://svn.apache.org/viewvc?rev=1055379&view=rev
Log:
In NPOIFS, close the file we opened in more exception cases

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java?rev=1055379&r1=1055378&r2=1055379&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java Wed Jan  5 09:42:00
2011
@@ -183,6 +183,14 @@ public class NPOIFSFileSystem extends Bl
              channel.close();
           }
           throw e;
+       } catch(RuntimeException e) {
+          // Comes from Iterators etc.
+          // TODO Decide if we can handle these better whilst
+          //  still sticking to the iterator contract
+          if(closeChannelOnError) {
+             channel.close();
+          }
+          throw e;
        }
     }
     



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


Mime
View raw message