mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
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:
parent
f64524916d
commit
d4373c2d09
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user