You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2014/11/07 23:33:35 UTC
svn commit: r1637474 -
/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java
Author: centic
Date: Fri Nov 7 22:33:35 2014
New Revision: 1637474
URL: http://svn.apache.org/r1637474
Log:
Slowly start to adjust places in tests where we do not properly close file handles
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java
Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java?rev=1637474&r1=1637473&r2=1637474&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java Fri Nov 7 22:33:35 2014
@@ -44,7 +44,10 @@ public class XWPFTestDataSamples {
public static byte[] getImage(String filename) throws IOException {
InputStream is = POIDataSamples.getDocumentInstance().openResourceAsStream(filename);
- byte[] result = IOUtils.toByteArray(is);
- return result;
+ try {
+ return IOUtils.toByteArray(is);
+ } finally {
+ is.close();
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org