From b3a0500abb9116ac4ef550ea1b27964ea94a00f9 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sun, 8 Nov 2015 23:44:24 +0000 Subject: [PATCH] Add reason message to @SuppressForbidden git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713324 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/util/FontMetricsDumper.java | 2 +- src/java/org/apache/poi/util/LocaleUtil.java | 4 ++-- src/java/org/apache/poi/util/SuppressForbidden.java | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/poi/util/FontMetricsDumper.java b/src/java/org/apache/poi/util/FontMetricsDumper.java index 96676954a1..10818c1ad3 100644 --- a/src/java/org/apache/poi/util/FontMetricsDumper.java +++ b/src/java/org/apache/poi/util/FontMetricsDumper.java @@ -29,7 +29,7 @@ import java.util.Properties; @SuppressWarnings("deprecation") public class FontMetricsDumper { - @SuppressForbidden + @SuppressForbidden("command line tool") public static void main( String[] args ) throws IOException { diff --git a/src/java/org/apache/poi/util/LocaleUtil.java b/src/java/org/apache/poi/util/LocaleUtil.java index d402be58c3..d7b4fcba59 100644 --- a/src/java/org/apache/poi/util/LocaleUtil.java +++ b/src/java/org/apache/poi/util/LocaleUtil.java @@ -50,7 +50,7 @@ public class LocaleUtil { private static final ThreadLocal userTimeZone = new ThreadLocal() { @Override - @SuppressForbidden + @SuppressForbidden("implementation around default locales in POI") protected TimeZone initialValue() { return TimeZone.getDefault(); } @@ -58,7 +58,7 @@ public class LocaleUtil { private static final ThreadLocal userLocale = new ThreadLocal() { @Override - @SuppressForbidden + @SuppressForbidden("implementation around default locales in POI") protected Locale initialValue() { return Locale.getDefault(); } diff --git a/src/java/org/apache/poi/util/SuppressForbidden.java b/src/java/org/apache/poi/util/SuppressForbidden.java index 81891e0c66..c2b7657041 100644 --- a/src/java/org/apache/poi/util/SuppressForbidden.java +++ b/src/java/org/apache/poi/util/SuppressForbidden.java @@ -22,11 +22,12 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -/* +/** * Marking class for elements to be ignored by the forbidden apis check */ @Retention(RetentionPolicy.CLASS) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface SuppressForbidden { - + /** A reason for suppressing should always be given. */ + String value() default ""; } -- 2.39.5