diff options
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java index c3505d42fb..4ad0d80a8c 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java @@ -172,11 +172,13 @@ class TestXWPFBugs { doc.write(out); out.close(); - XWPFDocument doc2 = new XWPFDocument(new ByteArrayInputStream(out.toByteArray())); - doc2.close(); + try (XWPFDocument doc2 = new XWPFDocument(new ByteArrayInputStream(out.toByteArray()))) { + assertNotNull(doc2); + } - XWPFDocument docBack = XWPFTestDataSamples.writeOutAndReadBack(doc); - docBack.close(); + try (XWPFDocument docBack = XWPFTestDataSamples.writeOutAndReadBack(doc)) { + assertNotNull(docBack); + } } } |