aboutsummaryrefslogtreecommitdiffstats
path: root/src/scratchpad/testcases/org/apache/poi/hslf/usermodel
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2016-12-13 00:36:03 +0000
committerAndreas Beeker <kiwiwings@apache.org>2016-12-13 00:36:03 +0000
commitbd3297c6176766ab4e32fa4f4fca603d2d3d9f0c (patch)
tree85b5ee2fe251ea0e514364e00525437c31cb6446 /src/scratchpad/testcases/org/apache/poi/hslf/usermodel
parenta79a7711b5e1328b302392a046b4fb35d3e094c8 (diff)
downloadpoi-bd3297c6176766ab4e32fa4f4fca603d2d3d9f0c.tar.gz
poi-bd3297c6176766ab4e32fa4f4fca603d2d3d9f0c.zip
eclipse warnings - close resources
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1773910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad/testcases/org/apache/poi/hslf/usermodel')
-rw-r--r--src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
index 0cabd81a6d..8b340079d3 100644
--- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
+++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
@@ -847,7 +847,6 @@ public final class TestBugs {
}
@Test
- @SuppressWarnings("resource")
public void bug57796() throws IOException {
HSLFSlideShow ppt = open("WithLinks.ppt");
HSLFSlide slide = ppt.getSlides().get(0);
@@ -859,7 +858,7 @@ public final class TestBugs {
assertEquals(hlRun.getId(), hlShape.getId());
assertEquals(hlRun.getAddress(), hlShape.getAddress());
assertEquals(hlRun.getLabel(), hlShape.getLabel());
- assertEquals(hlRun.getType(), hlShape.getType());
+ assertEquals(hlRun.getTypeEnum(), hlShape.getTypeEnum());
assertEquals(hlRun.getStartIndex(), hlShape.getStartIndex());
assertEquals(hlRun.getEndIndex(), hlShape.getEndIndex());
@@ -999,9 +998,16 @@ public final class TestBugs {
long persistId = vbaAtom.getPersistIdRef();
for (HSLFObjectData objData : ppt.getEmbeddedObjects()) {
if (objData.getExOleObjStg().getPersistId() == persistId) {
- return new VBAMacroReader(objData.getData()).readMacros();
+ VBAMacroReader mr = new VBAMacroReader(objData.getData());
+ try {
+ return mr.readMacros();
+ } finally {
+ mr.close();
+ }
}
}
+
+ ppt.close();
} finally {
IOUtils.closeQuietly(npoifs);