From 6f2f283db887c6179d36a7f3c0bfc5b98aaa00c8 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Wed, 26 Dec 2018 13:28:10 +0000 Subject: Fix various IDE warnings and some JavaDoc adjustments git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1849763 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hslf/usermodel/TestBugs.java | 20 ++++++++++---------- .../org/apache/poi/hwpf/usermodel/TestBug47563.java | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/scratchpad/testcases/org/apache') 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 3cf0c9a100..f2a111ea3b 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -579,20 +579,20 @@ public final class TestBugs { @Test public void bug47261() throws IOException { - HSLFSlideShow ppt = open("bug47261.ppt"); - ppt.removeSlide(0); - ppt.createSlide(); - HSLFTestDataSamples.writeOutAndReadBack(ppt).close(); - ppt.close(); + try (HSLFSlideShow ppt = open("bug47261.ppt")) { + ppt.removeSlide(0); + ppt.createSlide(); + HSLFTestDataSamples.writeOutAndReadBack(ppt).close(); + } } @Test public void bug56240() throws IOException { - HSLFSlideShow ppt = open("bug56240.ppt"); - int slideCnt = ppt.getSlides().size(); - assertEquals(105, slideCnt); - HSLFTestDataSamples.writeOutAndReadBack(ppt).close(); - ppt.close(); + try (HSLFSlideShow ppt = open("bug56240.ppt")) { + int slideCnt = ppt.getSlides().size(); + assertEquals(105, slideCnt); + HSLFTestDataSamples.writeOutAndReadBack(ppt).close(); + } } @Test diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug47563.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug47563.java index 5dbef749d6..a96460c1a8 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug47563.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug47563.java @@ -69,7 +69,6 @@ public class TestBug47563 extends TestCase { row.sanityCheck(); table.sanityCheck(); range.sanityCheck(); - } } @@ -77,7 +76,8 @@ public class TestBug47563 extends TestCase { int mustBeAfter = 0; for (int i = 0; i < rows * columns; i++) { int next = text.indexOf(Integer.toString(i), mustBeAfter); - assertTrue("Test with " + rows + "/" + columns + ": Should not find " + i + " but found it at " + next + " in " + text, + assertTrue("Test with " + rows + "/" + columns + ": Should not find " + i + " but found it at " + next + " with " + mustBeAfter + " in " + text + "\n" + + text.indexOf(Integer.toString(i), mustBeAfter), next != -1); mustBeAfter = next; } -- cgit v1.2.3