aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-10-26 15:02:52 +0000
committerPJ Fanning <fanningpj@apache.org>2023-10-26 15:02:52 +0000
commitd4373c2d098030e885aa33d799056b95aa42d7f1 (patch)
tree8b53d2e82ffdd62e1fc9ed534b62ad2ffdd26664 /poi
parentf64524916d449d37350e0763e4f86edc239bbd34 (diff)
downloadpoi-d4373c2d098030e885aa33d799056b95aa42d7f1.tar.gz
poi-d4373c2d098030e885aa33d799056b95aa42d7f1.zip
try to close streams in HSSF tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913351 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java b/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java
index e85ff044ab..32fdc0fc52 100644
--- a/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java
+++ b/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java
@@ -43,8 +43,8 @@ public final class HSSFTestDataSamples {
}
public static HSSFWorkbook openSampleWorkbook(String sampleFileName) {
- try {
- return new HSSFWorkbook(_inst.openResourceAsStream(sampleFileName));
+ try (InputStream stream = _inst.openResourceAsStream(sampleFileName)){
+ return new HSSFWorkbook(stream);
} catch (IOException e) {
throw new RuntimeException(e);
}