diff options
author | Dominik Stadler <centic@apache.org> | 2018-12-26 13:28:10 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2018-12-26 13:28:10 +0000 |
commit | 6f2f283db887c6179d36a7f3c0bfc5b98aaa00c8 (patch) | |
tree | f1bc97f162ac391d6a8a47c1335c2a383c555520 /src/scratchpad/testcases/org/apache/poi | |
parent | d40eb6f37f56a247669d2b4e0113d9587589d318 (diff) | |
download | poi-6f2f283db887c6179d36a7f3c0bfc5b98aaa00c8.tar.gz poi-6f2f283db887c6179d36a7f3c0bfc5b98aaa00c8.zip |
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
Diffstat (limited to 'src/scratchpad/testcases/org/apache/poi')
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java | 20 | ||||
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBug47563.java | 4 |
2 files changed, 12 insertions, 12 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 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; } |