From 808996a68357c9905f22f4d2157c119db670b691 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Wed, 14 Sep 2016 03:17:51 +0000 Subject: [PATCH] bug 59873: add @Removal annotations for deprecated CreationHelper#createHyperlink(int) and Hyperlink static aliases to HyperlinkType enum values git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760621 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/common/usermodel/Hyperlink.java | 7 +++++++ .../org/apache/poi/hssf/usermodel/HSSFCreationHelper.java | 2 ++ src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java | 2 ++ .../java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java | 4 ++++ .../org/apache/poi/xssf/streaming/SXSSFCreationHelper.java | 2 ++ .../org/apache/poi/xssf/usermodel/XSSFCreationHelper.java | 2 ++ .../java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java | 1 + 7 files changed, 20 insertions(+) diff --git a/src/java/org/apache/poi/common/usermodel/Hyperlink.java b/src/java/org/apache/poi/common/usermodel/Hyperlink.java index 132a3eb4c..abcdd112a 100644 --- a/src/java/org/apache/poi/common/usermodel/Hyperlink.java +++ b/src/java/org/apache/poi/common/usermodel/Hyperlink.java @@ -16,6 +16,8 @@ ==================================================================== */ package org.apache.poi.common.usermodel; +import org.apache.poi.util.Removal; + /** * Represents a hyperlink. */ @@ -25,6 +27,7 @@ public interface Hyperlink { * * @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#URL} instead. */ + @Removal(version="3.17") public static final int LINK_URL = 1; // HyperlinkType.URL.getCode() /** @@ -32,6 +35,7 @@ public interface Hyperlink { * * @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#DOCUMENT} instead. */ + @Removal(version="3.17") public static final int LINK_DOCUMENT = 2; // HyperlinkType.DOCUMENT.getCode() /** @@ -39,6 +43,7 @@ public interface Hyperlink { * * @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#EMAIL} instead. */ + @Removal(version="3.17") public static final int LINK_EMAIL = 3; // HyperlinkType.EMAIL.getCode() /** @@ -46,6 +51,7 @@ public interface Hyperlink { * * @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#FILE} instead. */ + @Removal(version="3.17") public static final int LINK_FILE = 4; // HyperlinkType.FILE.getCode() @@ -83,6 +89,7 @@ public interface Hyperlink { * @return the type of this hyperlink * @see HyperlinkType#forInt(int) * @deprecated POI 3.15 beta 3. Use {@link #getTypeEnum()} + * getType will return a HyperlinkType enum in the future. */ public int getType(); diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java index 7ce7ef1be..863d1a004 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java @@ -21,6 +21,7 @@ import org.apache.poi.common.usermodel.HyperlinkType; import org.apache.poi.hssf.record.common.ExtendedColor; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.util.Internal; +import org.apache.poi.util.Removal; public class HSSFCreationHelper implements CreationHelper { private final HSSFWorkbook workbook; @@ -50,6 +51,7 @@ public class HSSFCreationHelper implements CreationHelper { * @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead. */ @Deprecated + @Removal(version="3.17") @Override public HSSFHyperlink createHyperlink(int type) { return new HSSFHyperlink(type); diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java b/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java index 1847bfc0f..084a6bfe0 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFHyperlink.java @@ -273,6 +273,8 @@ public class HSSFHyperlink implements Hyperlink { * * @return the type of this hyperlink * @see HyperlinkType#forInt + * @deprecated POI 3.15. Use {@link #getTypeEnum()} instead. + * getType will return a HyperlinkType enum in the future. */ @Override public int getType() { diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java index 09b883c00..2f300623f 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFHyperlink.java @@ -69,6 +69,10 @@ public class XSLFHyperlink implements Hyperlink { _link.setTooltip(label); } + /* (non-Javadoc) + * @deprecated POI 3.15. Use {@link #getTypeEnum()} instead. + * Will return a HyperlinkType enum in the future + */ @Override public int getType() { return getTypeEnum().getCode(); diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCreationHelper.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCreationHelper.java index 201879702..f2687ff1d 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCreationHelper.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCreationHelper.java @@ -26,6 +26,7 @@ import org.apache.poi.ss.usermodel.Hyperlink; import org.apache.poi.util.Internal; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; +import org.apache.poi.util.Removal; import org.apache.poi.xssf.usermodel.XSSFCreationHelper; import org.apache.poi.xssf.usermodel.XSSFRichTextString; @@ -72,6 +73,7 @@ public class SXSSFCreationHelper implements CreationHelper { * @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead. */ @Deprecated + @Removal(version="3.17") @Override public Hyperlink createHyperlink(int type) { return helper.createHyperlink(type); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCreationHelper.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCreationHelper.java index 63dc78069..cb11a73b2 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCreationHelper.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCreationHelper.java @@ -20,6 +20,7 @@ import org.apache.poi.common.usermodel.HyperlinkType; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.Hyperlink; import org.apache.poi.util.Internal; +import org.apache.poi.util.Removal; public class XSSFCreationHelper implements CreationHelper { private final XSSFWorkbook workbook; @@ -61,6 +62,7 @@ public class XSSFCreationHelper implements CreationHelper { * @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead. */ @Deprecated + @Removal(version="3.17") @Override public XSSFHyperlink createHyperlink(int type) { return new XSSFHyperlink(type); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java index 1f1c8421f..9d26a6658 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java @@ -168,6 +168,7 @@ public class XSSFHyperlink implements Hyperlink { * @return the type of this hyperlink * @see HyperlinkType#forInt * @deprecated POI 3.15 beta 3. Use {@link #getTypeEnum()} instead. + * getType will return a HyperlinkType enum in the future. */ @Override public int getType() {