From 5d0b2fa59fa16fe869ad2b02a801e9fed016e481 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Sun, 17 Jul 2016 11:56:13 +0000 Subject: [PATCH] bug 59873: add @Internal and @Deprecated decorators to HyperlinkType enum git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753062 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/common/usermodel/HyperlinkType.java | 32 +++++++++++++++++++ .../apache/poi/ss/util/BaseTestCellUtil.java | 2 ++ 2 files changed, 34 insertions(+) diff --git a/src/java/org/apache/poi/common/usermodel/HyperlinkType.java b/src/java/org/apache/poi/common/usermodel/HyperlinkType.java index 0d8e139c87..dc88dc5608 100644 --- a/src/java/org/apache/poi/common/usermodel/HyperlinkType.java +++ b/src/java/org/apache/poi/common/usermodel/HyperlinkType.java @@ -49,7 +49,23 @@ public enum HyperlinkType { */ FILE(4); + + /** @deprecated POI 3.15 beta 3 */ + @Internal(since="3.15 beta 3") + @Deprecated private final int code; + + /** + * The codes don't have any real meaning. + * There bytes that are read in and written out from HSSF, HSLF, XSSF, and XSLF are different + * that the codes here. + * These codes only exist to assist in transitioning from using ints to enums. + * + * @param code + * @deprecated POI 3.15 beta 3 + */ + @Internal(since="3.15 beta 3") + @Deprecated private HyperlinkType(int code) { this.code = code; } @@ -61,10 +77,26 @@ public enum HyperlinkType { } } + /** + * @deprecated POI 3.15 beta 3 + * + * @return the old integer code for a HyperlinkType enum + */ + @Internal(since="3.15 beta 3") + @Deprecated public int getCode() { return code; } + /** + * @deprecated POI 3.15 beta 3 + * + * @param code the old integer code + * @return the corresponding HyperlinkEnum, if it exists + * @throws IllegalArgumentException if {@code code} is not a valid HyperlinkType. + */ + @Internal(since="3.15 beta 3") + @Deprecated public static HyperlinkType forInt(int code) { HyperlinkType type = map.get(code); if (type == null) { diff --git a/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java b/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java index c519e165a8..ed0c1da7e4 100644 --- a/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java +++ b/src/testcases/org/apache/poi/ss/util/BaseTestCellUtil.java @@ -213,7 +213,9 @@ public class BaseTestCellUtil { * @deprecated by {@link #setAlignmentEnum()} * * @throws IOException + * */ + @SuppressWarnings("deprecated") @Test public void setAlignment() throws IOException { Workbook wb = _testDataProvider.createWorkbook(); -- 2.39.5