From 8089682957b42a3ff5e7be66ad2b266e8ed45039 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sun, 25 Oct 2020 16:07:30 +0000 Subject: [PATCH] Fix Sonar issues and IDE warnings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882842 13f79535-47bb-0310-9956-ffa450edef68 --- .../xssf/usermodel/TestXSSFTableColumn.java | 5 +- .../apache/poi/hslf/record/TestCString.java | 15 ++--- .../poi/hslf/record/TestComment2000.java | 26 ++++----- .../hslf/record/TestStyleTextPropAtom.java | 58 ++++++++----------- 4 files changed, 47 insertions(+), 57 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java index 83cf5634a2..decc402508 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTableColumn.java @@ -71,9 +71,8 @@ public final class TestXSSFTableColumn { assertNotNull(tableColumns.get(0).getXmlColumnPr()); assertNull(tableColumns.get(1).getXmlColumnPr()); // unmapped column - assertNotNull(tableColumns.get(2).getColumnIndex()); - assertNotNull(tableColumns.get(3).getColumnIndex()); - + assertEquals(2, tableColumns.get(2).getColumnIndex()); + assertEquals(3, tableColumns.get(3).getColumnIndex()); } } } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java index 51f8c2daa3..124ece203e 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java @@ -19,7 +19,7 @@ package org.apache.poi.hslf.record; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertFalse; import java.io.ByteArrayOutputStream; @@ -97,14 +97,15 @@ public final class TestCString { ca.setText("Comments"); ca.setOptions(0x10); - try { - for(int i=0; i */ @Test - public void test45815() { + public void test45815() throws IOException { int length = 19; byte[] data = { 0x00, 0x00, (byte)0xA1, 0x0F, 0x5E, 0x00, 0x00, 0x00, 0x14, 0x00, @@ -789,8 +780,7 @@ public final class TestStyleTextPropAtom { // the bitmask text properties will sanitize the bytes and thus the bytes differ byte[] exptected = data.clone(); exptected[18] = 0; - + doReadWrite(data, exptected, length); } - }