aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases
diff options
context:
space:
mode:
Diffstat (limited to 'src/ooxml/testcases')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
index 9e592df284..efabb8c00e 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
@@ -417,10 +417,8 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
private static void saveTwice(Workbook wb) throws Exception {
for (int i = 0; i < 2; i++) {
- try {
- NullOutputStream out = new NullOutputStream();
+ try (NullOutputStream out = new NullOutputStream()) {
wb.write(out);
- out.close();
} catch (Exception e) {
throw new Exception("ERROR: failed on " + (i + 1)
+ "th time calling " + wb.getClass().getName()