aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hpsf/basic/Util.java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2014-05-04 08:05:32 +0000
committerDominik Stadler <centic@apache.org>2014-05-04 08:05:32 +0000
commit525b8b53354bea6acaccb00f82abf7991a44914a (patch)
tree5fbb3ba68f040153d51da53452068fcfbf0d26f6 /src/testcases/org/apache/poi/hpsf/basic/Util.java
parent1bf21ef3f93280b669c331d16be5003a77011893 (diff)
downloadpoi-525b8b53354bea6acaccb00f82abf7991a44914a.tar.gz
poi-525b8b53354bea6acaccb00f82abf7991a44914a.zip
File leak detector: Close streams in some tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1592315 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hpsf/basic/Util.java')
-rw-r--r--src/testcases/org/apache/poi/hpsf/basic/Util.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/testcases/org/apache/poi/hpsf/basic/Util.java b/src/testcases/org/apache/poi/hpsf/basic/Util.java
index 1262c750d8..3af8cd94f9 100644
--- a/src/testcases/org/apache/poi/hpsf/basic/Util.java
+++ b/src/testcases/org/apache/poi/hpsf/basic/Util.java
@@ -229,7 +229,13 @@ final class Util {
r.registerListener(pfl);
/* Read the POI filesystem. */
- r.read(new FileInputStream(poiFs));
+ FileInputStream stream = new FileInputStream(poiFs);
+ try {
+ r.read(stream);
+ } finally {
+ stream.close();
+ }
+
POIFile[] result = new POIFile[files.size()];
for (int i = 0; i < result.length; i++)
result[i] = (POIFile) files.get(i);