try to close streams in HSSF tests

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913351 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2023-10-26 15:02:52 +00:00
parent f64524916d
commit d4373c2d09

View File

@ -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);
}