diff options
author | PJ Fanning <fanningpj@apache.org> | 2020-12-09 20:42:19 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2020-12-09 20:42:19 +0000 |
commit | ea56d752f4c93af19a136601e6e28926a95cfe4e (patch) | |
tree | 1cdbbbff3301efc6b4723d48b4e876da51978dcc | |
parent | ea59cc2bc90b4ab8401217f469cde4d4ab63d789 (diff) | |
download | poi-ea56d752f4c93af19a136601e6e28926a95cfe4e.tar.gz poi-ea56d752f4c93af19a136601e6e28926a95cfe4e.zip |
remove more deprecated code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884269 13f79535-47bb-0310-9956-ffa450edef68
28 files changed, 47 insertions, 299 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 592ff3a007..155aa70556 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -4070,19 +4070,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { } /** - * Creates a new Table, and associates it with this Sheet. The table does - * not yet have an area defined and needs to be initialized by calling - * {@link XSSFTable#setArea(AreaReference)}. - * - * @deprecated Use {@link #createTable(AreaReference))} instead - */ - @Deprecated - @Removal(version = "4.2.0") - public XSSFTable createTable() { - return createTable(null); - } - - /** * Creates a new Table, and associates it with this Sheet. * <p> * The table is assigned a default display name (since 4.1.1) which can be overridden diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java index 31b6e320cf..62f6158deb 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java @@ -220,18 +220,11 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } return tableColumns; } - + /** - * Note this list is static - once read, it does not notice later changes to the underlying column structures - * To clear the cache, call {@link #updateHeaders} - * - * @deprecated Use {@link XSSFTableColumn#getXmlColumnPr()} instead. - * - * @return List of XSSFXmlColumnPr + * Use {@link XSSFTableColumn#getXmlColumnPr()} instead. */ - @Deprecated - @Removal(version="4.2.0") - public List<XSSFXmlColumnPr> getXmlColumnPrs() { + private List<XSSFXmlColumnPr> getXmlColumnPrs() { if (xmlColumnPrs == null) { xmlColumnPrs = new ArrayList<>(); for (XSSFTableColumn column: getColumns()) { @@ -439,17 +432,6 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } /** - * @deprecated Use {@link #getColumnCount()} instead. - * - * @return the number of mapped table columns (see Open Office XML Part 4: chapter 3.5.1.4) - */ - @Deprecated - @Removal(version = "4.2.0") - public long getNumberOfMappedColumns() { - return ctTable.getTableColumns().getCount(); - } - - /** * Get the area reference for the cells which this table covers. The area * includes header rows and totals rows. * diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java index 733da646f9..45f08f8f0f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFTable.java @@ -89,7 +89,7 @@ public final class TestXSSFTable { XSSFSheet sheet = outputWorkbook.createSheet(); //Create - XSSFTable outputTable = sheet.createTable(); + XSSFTable outputTable = sheet.createTable(null); outputTable.setDisplayName("Test"); CTTable outputCTTable = outputTable.getCTTable(); @@ -224,15 +224,6 @@ public final class TestXSSFTable { } @Test - public void getNumberOfMappedColumns() throws IOException { - try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) { - XSSFTable table = wb.getTable("\\_Prime.1"); - //noinspection deprecation - assertEquals(3, table.getNumberOfMappedColumns()); - } - } - - @Test public void getColumnCount() throws IOException { try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) { XSSFTable table = wb.getTable("\\_Prime.1"); @@ -258,7 +249,7 @@ public final class TestXSSFTable { // can be synchronized with the underlying CTTable try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); - XSSFTable table = sh.createTable(); + XSSFTable table = sh.createTable(null); assertNotNull(table.getDisplayName()); assertNotNull(table.getCTTable().getDisplayName()); CTTable ctTable = table.getCTTable(); @@ -289,7 +280,7 @@ public final class TestXSSFTable { public void getRowCount() throws IOException { try (XSSFWorkbook wb = new XSSFWorkbook()) { XSSFSheet sh = wb.createSheet(); - XSSFTable table = sh.createTable(); + XSSFTable table = sh.createTable(null); CTTable ctTable = table.getCTTable(); assertEquals(0, table.getRowCount()); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index e2b2d88d5e..c13d96bc2d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -1102,7 +1102,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { // If a table is added after getTable is called it should still be reachable by XSSFWorkbook.getTable // This test makes sure that if any caching is done that getTable never uses a stale cache - XSSFTable table2 = wb.getSheet("Foglio2").createTable(); + XSSFTable table2 = wb.getSheet("Foglio2").createTable(null); table2.setName("Table2"); assertSame("Did not find Table2", table2, wb.getTable("Table2")); diff --git a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java index 6a12894998..2b42db7209 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/datatypes/DirectoryChunk.java @@ -49,18 +49,6 @@ public class DirectoryChunk extends Chunk { * Treats the directory as an embedded MAPIMessage (it normally is one), and * returns a MAPIMessage object to process it with. * - * @deprecated use {@link #getAsEmbeddedMessage()} instead - */ - @Removal(version = "4.3") - @Deprecated - public MAPIMessage getAsEmbededMessage() throws IOException { - return getAsEmbeddedMessage(); - } - - /** - * Treats the directory as an embedded MAPIMessage (it normally is one), and - * returns a MAPIMessage object to process it with. - * * @since 4.1.1 */ public MAPIMessage getAsEmbeddedMessage() throws IOException { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarkFirstDescriptor.java b/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarkFirstDescriptor.java index 617868be11..0de0daf226 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarkFirstDescriptor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/BookmarkFirstDescriptor.java @@ -21,7 +21,6 @@ import java.util.Objects; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.BKFAbstractType; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; @Internal public final class BookmarkFirstDescriptor extends BKFAbstractType implements Duplicatable { @@ -36,14 +35,6 @@ public final class BookmarkFirstDescriptor extends BKFAbstractType implements Du } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - protected BookmarkFirstDescriptor clone() { - return copy(); - } - - @Override public BookmarkFirstDescriptor copy() { return new BookmarkFirstDescriptor(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java index 0aff01bfac..8367aa84fd 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/CHPBinTable.java @@ -156,7 +156,7 @@ public class CHPBinTable if ( hasChp ) { - SprmBuffer newSprmBuffer = sprmBuffer.clone(); + SprmBuffer newSprmBuffer = sprmBuffer.copy(); CHPX chpx = new CHPX( textPiece.getStart(), textPiece.getEnd(), newSprmBuffer ); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/Colorref.java b/src/scratchpad/src/org/apache/poi/hwpf/model/Colorref.java index 6deb288ea5..7ae494fb05 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/Colorref.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/Colorref.java @@ -19,7 +19,6 @@ package org.apache.poi.hwpf.model; import org.apache.poi.common.Duplicatable; import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.Removal; /** * 24-bit color structure @@ -88,14 +87,6 @@ public class Colorref implements Duplicatable { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public Colorref clone() { - return copy(); - } - - @Override public Colorref copy() { return new Colorref(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FootnoteReferenceDescriptor.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FootnoteReferenceDescriptor.java index 8d7d224593..6c21ff2fd7 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FootnoteReferenceDescriptor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FootnoteReferenceDescriptor.java @@ -21,7 +21,6 @@ import java.util.Objects; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.FRDAbstractType; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; @Internal public final class FootnoteReferenceDescriptor extends FRDAbstractType implements Duplicatable { @@ -36,14 +35,6 @@ public final class FootnoteReferenceDescriptor extends FRDAbstractType implement } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - protected FootnoteReferenceDescriptor clone() { - return copy(); - } - - @Override public FootnoteReferenceDescriptor copy() { return new FootnoteReferenceDescriptor(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/Hyphenation.java b/src/scratchpad/src/org/apache/poi/hwpf/model/Hyphenation.java index 00c2b91558..ac391ba780 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/Hyphenation.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/Hyphenation.java @@ -24,7 +24,6 @@ import org.apache.poi.hwpf.model.types.HRESIAbstractType; import org.apache.poi.hwpf.usermodel.CharacterProperties; import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.Removal; /** * Hyphenation. Substructure of the {@link CharacterProperties}. @@ -44,14 +43,6 @@ public final class Hyphenation extends HRESIAbstractType implements Duplicatable } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public Hyphenation clone() { - return copy(); - } - - @Override public Hyphenation copy() { return new Hyphenation(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyModifier.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyModifier.java index 5cfc1e38fe..a2e0bd2ff3 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyModifier.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyModifier.java @@ -21,7 +21,6 @@ import java.util.Objects; import org.apache.poi.common.Duplicatable; import org.apache.poi.util.BitField; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; @Internal public final class PropertyModifier implements Duplicatable { @@ -56,14 +55,6 @@ public final class PropertyModifier implements Duplicatable { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - protected PropertyModifier clone() { - return copy(); - } - - @Override public PropertyModifier copy() { return new PropertyModifier(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java index 643571a396..9448f6034b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java @@ -25,7 +25,6 @@ import org.apache.poi.common.Duplicatable; import org.apache.poi.util.Internal; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; -import org.apache.poi.util.Removal; /** * Represents a lightweight node in the Trees used to store content @@ -153,14 +152,6 @@ public abstract class PropertyNode<T extends PropertyNode<T>> implements Compara } @Override - @Deprecated - @Removal(version = "5.0.0") - @SuppressWarnings({"unchecked","squid:S2975"}) - public T clone() { - return (T) copy(); - } - - @Override public abstract PropertyNode<?> copy(); /** diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java index f7ebeab350..0f2e92222d 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java @@ -45,7 +45,7 @@ public final class CharacterSprmUncompressor extends SprmUncompressor public static CharacterProperties uncompressCHP( CharacterProperties parent, byte[] grpprl, int offset ) { - CharacterProperties newProperties = parent.clone(); + CharacterProperties newProperties = parent.copy(); applySprms( parent, grpprl, offset, true, newProperties ); return newProperties; } @@ -61,7 +61,7 @@ public final class CharacterSprmUncompressor extends SprmUncompressor } else { - newProperties = parStyle.clone(); + newProperties = parStyle.copy(); } /* @@ -84,7 +84,7 @@ public final class CharacterSprmUncompressor extends SprmUncompressor } CharacterProperties styleProperties = newProperties; - newProperties = styleProperties.clone(); + newProperties = styleProperties.copy(); try { @@ -329,7 +329,7 @@ public final class CharacterSprmUncompressor extends SprmUncompressor case 0x33: // preserve the fSpec setting from the original CHP boolean fSpec = newCHP.isFSpec(); - newCHP = oldCHP.clone(); + newCHP = oldCHP.copy(); newCHP.setFSpec( fSpec ); return; case 0x34: diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java index d18f8219aa..201d069742 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmBuffer.java @@ -24,7 +24,6 @@ import org.apache.poi.util.IOUtils; import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndianConsts; -import org.apache.poi.util.Removal; @Internal public final class SprmBuffer implements Duplicatable { @@ -108,14 +107,6 @@ public final class SprmBuffer implements Duplicatable { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public SprmBuffer clone() { - return copy(); - } - - @Override public SprmBuffer copy() { return new SprmBuffer(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java index cb7ffc95ac..9f2c1ab466 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BorderCode.java @@ -22,7 +22,6 @@ import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndianConsts; -import org.apache.poi.util.Removal; /** * Mapping class for BRC80 structure (Border Code for Word 97) @@ -89,14 +88,6 @@ public final class BorderCode implements Duplicatable { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public BorderCode clone() { - return copy(); - } - - @Override public BorderCode copy() { return new BorderCode(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java index 3c444cd52c..71e98888e0 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterProperties.java @@ -20,7 +20,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.Colorref; import org.apache.poi.hwpf.model.types.CHPAbstractType; -import org.apache.poi.util.Removal; @SuppressWarnings("unused") public final class CharacterProperties extends CHPAbstractType implements Duplicatable { @@ -372,14 +371,6 @@ public final class CharacterProperties extends CHPAbstractType implements Duplic } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public CharacterProperties clone() { - return copy(); - } - - @Override public CharacterProperties copy() { return new CharacterProperties(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java index 4e51c747de..96fb227dd9 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java @@ -26,7 +26,6 @@ import org.apache.poi.hwpf.model.Ffn; import org.apache.poi.hwpf.model.NilPICFAndBinData; import org.apache.poi.hwpf.model.StyleSheet; import org.apache.poi.hwpf.sprm.SprmBuffer; -import org.apache.poi.util.Removal; import java.math.BigDecimal; import java.math.RoundingMode; @@ -567,19 +566,6 @@ public final class CharacterRun extends Range implements Duplicatable, org.apach _props.setIco24(colour24); } - /** - * Used to create a deep copy of this object. - * - * @return A deep copy. - */ - @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public CharacterRun clone() { - return copy(); - } - @Override public CharacterRun copy() { return new CharacterRun(this); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java index be677fba87..38c4a2895c 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DateAndTime.java @@ -17,15 +17,10 @@ package org.apache.poi.hwpf.usermodel; -import java.util.Calendar; - import org.apache.poi.common.Duplicatable; -import org.apache.poi.util.BitField; -import org.apache.poi.util.BitFieldFactory; -import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.LittleEndianConsts; -import org.apache.poi.util.LocaleUtil; -import org.apache.poi.util.Removal; +import org.apache.poi.util.*; + +import java.util.Calendar; /** * This class is used to represent a date and time in a Word document. @@ -42,7 +37,8 @@ public final class DateAndTime implements Duplicatable { private short _info; private short _info2; - public DateAndTime() {} + public DateAndTime() { + } public DateAndTime(DateAndTime other) { _info = other._info; @@ -54,60 +50,49 @@ public final class DateAndTime implements Duplicatable { _info2 = LittleEndian.getShort(buf, offset + LittleEndianConsts.SHORT_SIZE); } - public Calendar getDate() { - // TODO Discover if the timezone is stored somewhere else or not - return LocaleUtil.getLocaleCalendar( - _years.getValue(_info2)+1900, - _months.getValue(_info2)-1, - _dom.getValue(_info), - _hours.getValue(_info), - _minutes.getValue(_info), - 0 - ); - } - - public void serialize(byte[] buf, int offset) - { - LittleEndian.putShort(buf, offset, _info); - LittleEndian.putShort(buf, offset + LittleEndianConsts.SHORT_SIZE, _info2); - } - - @Override - public boolean equals(Object o) - { - if (!(o instanceof DateAndTime)) return false; - DateAndTime dttm = (DateAndTime)o; - return _info == dttm._info && _info2 == dttm._info2; - } - - @Override - public int hashCode() { - assert false : "hashCode not designed"; - return 42; // any arbitrary constant will do - } + public Calendar getDate() { + // TODO Discover if the timezone is stored somewhere else or not + return LocaleUtil.getLocaleCalendar( + _years.getValue(_info2) + 1900, + _months.getValue(_info2) - 1, + _dom.getValue(_info), + _hours.getValue(_info), + _minutes.getValue(_info), + 0 + ); + } + + public void serialize(byte[] buf, int offset) { + LittleEndian.putShort(buf, offset, _info); + LittleEndian.putShort(buf, offset + LittleEndianConsts.SHORT_SIZE, _info2); + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof DateAndTime)) return false; + DateAndTime dttm = (DateAndTime) o; + return _info == dttm._info && _info2 == dttm._info2; + } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public DateAndTime clone() { - return copy(); + public int hashCode() { + assert false : "hashCode not designed"; + return 42; // any arbitrary constant will do } + @Override public DateAndTime copy() { return new DateAndTime(this); } - public boolean isEmpty() - { + public boolean isEmpty() { return _info == 0 && _info2 == 0; } @Override - public String toString() - { - if ( isEmpty() ) + public String toString() { + if (isEmpty()) return "[DTTM] EMPTY"; return "[DTTM] " + getDate(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java index f391bb887f..c5589f0d52 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/DropCapSpecifier.java @@ -21,7 +21,6 @@ import org.apache.poi.common.Duplicatable; import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.Removal; /** * This data structure is used by a paragraph to determine how it should drop @@ -51,14 +50,6 @@ public final class DropCapSpecifier implements Duplicatable { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public DropCapSpecifier clone() { - return copy(); - } - - @Override public DropCapSpecifier copy() { return new DropCapSpecifier(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java index 181dc6f75d..8849f8aa75 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/LineSpacingDescriptor.java @@ -20,7 +20,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndianConsts; -import org.apache.poi.util.Removal; /** * This class is used to determine line spacing for a paragraph. @@ -46,14 +45,6 @@ public final class LineSpacingDescriptor implements Duplicatable { } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public LineSpacingDescriptor clone() { - return copy(); - } - - @Override public LineSpacingDescriptor copy() { return new LineSpacingDescriptor(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java index b335fc85a9..f1c78be1d9 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java @@ -19,7 +19,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.PAPAbstractType; -import org.apache.poi.util.Removal; @SuppressWarnings("unused") public final class ParagraphProperties extends PAPAbstractType implements Duplicatable { @@ -37,14 +36,6 @@ public final class ParagraphProperties extends PAPAbstractType implements Duplic } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public ParagraphProperties clone() { - return copy(); - } - - @Override public ParagraphProperties copy() { return new ParagraphProperties(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java index 89b0846659..ac0e6f25af 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java @@ -20,7 +20,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.HWPFOldDocument; import org.apache.poi.hwpf.model.SEPX; -import org.apache.poi.util.Removal; public final class Section extends Range implements Duplicatable { private final SectionProperties _props; @@ -41,14 +40,6 @@ public final class Section extends Range implements Duplicatable { } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public Section clone() { - return copy(); - } - - @Override public Section copy() { return new Section(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java index 1eeb47a511..72f688ad3a 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/SectionProperties.java @@ -19,7 +19,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.SEPAbstractType; -import org.apache.poi.util.Removal; public final class SectionProperties extends SEPAbstractType implements Duplicatable { private short field_60_rncftn; @@ -51,14 +50,6 @@ public final class SectionProperties extends SEPAbstractType implements Duplicat } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public SectionProperties clone() { - return copy(); - } - - @Override public SectionProperties copy() { return new SectionProperties(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java index 85e2d1c233..5274645f51 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor.java @@ -19,7 +19,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.SHDAbstractType; -import org.apache.poi.util.Removal; /** * The SHD is a substructure of the CHP, PAP, and TC for Word 2000. @@ -37,14 +36,6 @@ public final class ShadingDescriptor extends SHDAbstractType implements Duplicat } @Override - @SuppressWarnings("squid:S2975") - @Deprecated - @Removal(version = "5.0.0") - public ShadingDescriptor clone() { - return copy(); - } - - @Override public ShadingDescriptor copy() { return new ShadingDescriptor(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor80.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor80.java index e40e499b21..aefd3feb9f 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor80.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ShadingDescriptor80.java @@ -20,7 +20,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.Colorref; import org.apache.poi.hwpf.model.types.SHD80AbstractType; -import org.apache.poi.util.Removal; /** * The SHD80 is a substructure of the CHP and PAP, and TC for Word 97. @@ -43,14 +42,6 @@ public final class ShadingDescriptor80 extends SHD80AbstractType implements Dupl } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public ShadingDescriptor80 clone() { - return copy(); - } - - @Override public ShadingDescriptor80 copy() { return new ShadingDescriptor80(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableAutoformatLookSpecifier.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableAutoformatLookSpecifier.java index 305ee149a6..8893c4da2b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableAutoformatLookSpecifier.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableAutoformatLookSpecifier.java @@ -20,7 +20,6 @@ import java.util.Objects; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.TLPAbstractType; -import org.apache.poi.util.Removal; public class TableAutoformatLookSpecifier extends TLPAbstractType implements Duplicatable { public static final int SIZE = 4; @@ -36,14 +35,6 @@ public class TableAutoformatLookSpecifier extends TLPAbstractType implements Dup } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public TableAutoformatLookSpecifier clone() { - return copy(); - } - - @Override public TableAutoformatLookSpecifier copy() { return new TableAutoformatLookSpecifier(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java index ad31a92361..e7e99373c7 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableCellDescriptor.java @@ -20,7 +20,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.TCAbstractType; import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.Removal; public final class TableCellDescriptor extends TCAbstractType implements Duplicatable { public static final int SIZE = 20; @@ -52,14 +51,6 @@ public final class TableCellDescriptor extends TCAbstractType implements Duplica } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public TableCellDescriptor clone() { - return copy(); - } - - @Override public TableCellDescriptor copy() { return new TableCellDescriptor(this); } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java index 999d2a9e58..eec31c4815 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableProperties.java @@ -19,7 +19,6 @@ package org.apache.poi.hwpf.usermodel; import org.apache.poi.common.Duplicatable; import org.apache.poi.hwpf.model.types.TAPAbstractType; -import org.apache.poi.util.Removal; public final class TableProperties extends TAPAbstractType implements Duplicatable { @@ -65,14 +64,6 @@ public final class TableProperties extends TAPAbstractType implements Duplicatab } @Override - @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"}) - @Deprecated - @Removal(version = "5.0.0") - public TableProperties clone() { - return copy(); - } - - @Override public TableProperties copy() { return new TableProperties(this); } |