diff options
author | Dominik Stadler <centic@apache.org> | 2014-11-07 22:33:35 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2014-11-07 22:33:35 +0000 |
commit | 5f50592706d0f8dfef63e303e847d9902f9e5590 (patch) | |
tree | ee325e60622e9e4d0b43191d57ac44df1ae9d4f5 /src | |
parent | dd840c39d874cf74e08850ef813fc09d96feef48 (diff) | |
download | poi-5f50592706d0f8dfef63e303e847d9902f9e5590.tar.gz poi-5f50592706d0f8dfef63e303e847d9902f9e5590.zip |
Slowly start to adjust places in tests where we do not properly close file handles
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1637474 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java b/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java index 4270778887..d7f2222404 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/XWPFTestDataSamples.java @@ -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();
+ }
}
}
|