diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-11-22 12:30:42 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-11-22 12:30:42 +0000 |
commit | 4241f26a136fb3040e2a5998b413244e50f7db3b (patch) | |
tree | 179613c3049508c6fff4706e62028f6b517b708b /src/testcases | |
parent | 9341c081198a947c26edf1dbe327aa745d10b1bc (diff) | |
download | poi-4241f26a136fb3040e2a5998b413244e50f7db3b.tar.gz poi-4241f26a136fb3040e2a5998b413244e50f7db3b.zip |
fix unnecessary cast warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1715626 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
10 files changed, 13 insertions, 18 deletions
diff --git a/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java b/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java index 963f657b96..3b6354e4da 100644 --- a/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java +++ b/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java @@ -62,7 +62,7 @@ public class TestVariantSupport extends TestCase { PropertySet ps = PropertySetFactory.create(new ByteArrayInputStream(bytes)); DocumentSummaryInformation dsi = (DocumentSummaryInformation) ps; - Section s = (Section) dsi.getSections().get(0); + Section s = dsi.getSections().get(0); Object hdrs = s.getProperty(PropertyIDMap.PID_HEADINGPAIR); diff --git a/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java b/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java index 8319657c69..8d69af8ba5 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java @@ -57,7 +57,7 @@ public final class TestAutoFilterInfoRecord extends TestCase { record.setNumEntries((short)3); byte[] src = record.serialize(); - AutoFilterInfoRecord cloned = (AutoFilterInfoRecord)record.clone(); + AutoFilterInfoRecord cloned = record.clone(); assertEquals(3, record.getNumEntries()); byte[] cln = cloned.serialize(); diff --git a/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java b/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java index c39e3e4048..3b2591e89c 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java @@ -437,7 +437,7 @@ public final class TestCFRuleRecord extends TestCase { CFRuleRecord record = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "2", "5"); - CFRuleRecord clone = (CFRuleRecord) record.clone(); + CFRuleRecord clone = record.clone(); byte [] serializedRecord = record.serialize(); byte [] serializedClone = clone.serialize(); diff --git a/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java index f158f86422..d8a1de9d03 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java @@ -56,7 +56,7 @@ public final class TestFtCblsSubRecord extends TestCase { FtCblsSubRecord record = new FtCblsSubRecord(); byte[] src = record.serialize(); - FtCblsSubRecord cloned = (FtCblsSubRecord)record.clone(); + FtCblsSubRecord cloned = record.clone(); byte[] cln = cloned.serialize(); assertEquals(record.getDataSize(), cloned.getDataSize()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java b/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java index d1e5631b9d..1bb3b1924c 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestHyperlinkRecord.java @@ -432,7 +432,7 @@ public final class TestHyperlinkRecord { for (int i = 0; i < data.length; i++) { RecordInputStream is = TestcaseRecordInputStream.create(HyperlinkRecord.sid, data[i]); HyperlinkRecord link = new HyperlinkRecord(is); - HyperlinkRecord clone = (HyperlinkRecord)link.clone(); + HyperlinkRecord clone = link.clone(); assertArrayEquals(link.serialize(), clone.serialize()); } diff --git a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java index a203ae4c2b..1063c0c208 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestMergeCellsRecord.java @@ -42,7 +42,7 @@ public final class TestMergeCellsRecord extends TestCase { public void testCloneReferences() { CellRangeAddress[] cras = { new CellRangeAddress(0, 1, 0, 2), }; MergeCellsRecord merge = new MergeCellsRecord(cras, 0, cras.length); - MergeCellsRecord clone = (MergeCellsRecord)merge.clone(); + MergeCellsRecord clone = merge.clone(); assertNotSame("Merged and cloned objects are the same", merge, clone); diff --git a/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java index 427a48f935..4da04e014f 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java @@ -73,7 +73,7 @@ public final class TestNoteRecord extends TestCase { record.setShapeId((short)1026); record.setAuthor("Apache Software Foundation"); - NoteRecord cloned = (NoteRecord)record.clone(); + NoteRecord cloned = record.clone(); assertEquals(record.getRow(), cloned.getRow()); assertEquals(record.getColumn(), cloned.getColumn()); assertEquals(record.getFlags(), cloned.getFlags()); diff --git a/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java index db3367a033..1b5fb008e3 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java @@ -58,7 +58,7 @@ public final class TestNoteStructureSubRecord extends TestCase { NoteStructureSubRecord record = new NoteStructureSubRecord(); byte[] src = record.serialize(); - NoteStructureSubRecord cloned = (NoteStructureSubRecord)record.clone(); + NoteStructureSubRecord cloned = record.clone(); byte[] cln = cloned.serialize(); assertEquals(record.getDataSize(), cloned.getDataSize()); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java b/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java index 21494b39ba..8153b53ea1 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestDocument.java @@ -159,10 +159,7 @@ public final class TestDocument extends TestCase { } else { - copy = new OPOIFSDocument( - "test" + input.length, - ( SmallDocumentBlock [] ) document.getSmallBlocks(), - input.length); + copy = new OPOIFSDocument("test"+input.length, document.getSmallBlocks(), input.length); } return copy; } diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java b/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java index eb1b570300..18268068f5 100644 --- a/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestMathX.java @@ -20,8 +20,6 @@ */ package org.apache.poi.ss.formula.functions; -import java.lang.reflect.Constructor; - import org.apache.poi.ss.formula.functions.XYNumericFunction.Accumulator; @@ -305,10 +303,10 @@ public class TestMathX extends AbstractNumericTestCase { assertEquals(0.0, MathX.mod(0, 2)); assertEquals(Double.NaN, MathX.mod(3, 0)); - assertEquals((double) 1.4, MathX.mod(3.4, 2)); - assertEquals((double) -1.4, MathX.mod(-3.4, -2)); - assertEquals((double) 0.6000000000000001, MathX.mod(-3.4, 2.0));// should actually be 0.6 - assertEquals((double) -0.6000000000000001, MathX.mod(3.4, -2.0));// should actually be -0.6 + assertEquals(1.4, MathX.mod(3.4, 2)); + assertEquals(-1.4, MathX.mod(-3.4, -2)); + assertEquals(0.6000000000000001, MathX.mod(-3.4, 2.0));// should actually be 0.6 + assertEquals(-0.6000000000000001, MathX.mod(3.4, -2.0));// should actually be -0.6 assertEquals(3.0, MathX.mod(3, Double.MAX_VALUE)); assertEquals(2.0, MathX.mod(Double.MAX_VALUE, 3)); |