From 3cbba391da0dcbadf908c6c461445a9866d5eb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 6 Dec 2018 15:03:58 +0100 Subject: [PATCH] Add deprecation notices --- .../pmd/properties/LongMultiProperty.java | 12 ++++++++++++ .../sourceforge/pmd/properties/LongProperty.java | 13 ++++++++++++- .../pmd/properties/LongPropertyTest.java | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongMultiProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongMultiProperty.java index eb07bf17bc..3634c506b9 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongMultiProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongMultiProperty.java @@ -16,7 +16,11 @@ import net.sourceforge.pmd.properties.builders.PropertyDescriptorBuilderConversi * * @author Brian Remedios * @version Refactored June 2017 (6.0.0) + * + * @deprecated Use a {@code PropertyDescriptor>} instead. A builder is available from {@link PropertyFactory#longIntListProperty(String)}. + * This class will be removed in 7.0.0. */ +@Deprecated public final class LongMultiProperty extends AbstractMultiNumericProperty { @@ -31,7 +35,9 @@ public final class LongMultiProperty extends AbstractMultiNumericProperty * @param theUIOrder UI order * * @throws IllegalArgumentException if {@literal min > max} or one of the defaults is not between the bounds + * @deprecated Use {@link PropertyFactory#longIntListProperty(String)} */ + @Deprecated public LongMultiProperty(String theName, String theDescription, Long min, Long max, Long[] defaultValues, float theUIOrder) { this(theName, theDescription, min, max, Arrays.asList(defaultValues), theUIOrder, false); @@ -56,7 +62,9 @@ public final class LongMultiProperty extends AbstractMultiNumericProperty * @param theUIOrder UI order * * @throws IllegalArgumentException if {@literal min > max} or one of the defaults is not between the bounds + * @deprecated Use {@link PropertyFactory#longIntListProperty(String)} */ + @Deprecated public LongMultiProperty(String theName, String theDescription, Long min, Long max, List defaultValues, float theUIOrder) { this(theName, theDescription, min, max, defaultValues, theUIOrder, false); @@ -85,11 +93,15 @@ public final class LongMultiProperty extends AbstractMultiNumericProperty } + /** @deprecated Use {@link PropertyFactory#longIntListProperty(String)} */ + @Deprecated public static LongMultiPBuilder named(String name) { return new LongMultiPBuilder(name); } + /** @deprecated Use {@link PropertyFactory#longIntListProperty(String)} */ + @Deprecated public static final class LongMultiPBuilder extends MultiNumericPropertyBuilder { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongProperty.java index 020dc50f3e..e420a3b739 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/LongProperty.java @@ -14,7 +14,11 @@ import net.sourceforge.pmd.properties.builders.SingleNumericPropertyBuilder; * @author Brian Remedios * @author Clément Fournier * @version Refactored June 2017 (6.0.0) + * + * @deprecated Use a {@code PropertyDescriptor} instead. A builder is available from {@link PropertyFactory#longIntProperty(String)}. + * This class will be removed in 7.0.0. */ +@Deprecated public final class LongProperty extends AbstractNumericProperty { @@ -30,8 +34,9 @@ public final class LongProperty extends AbstractNumericProperty { * @param theUIOrder UI order * * @throws IllegalArgumentException if {@literal min > max} or one of the defaults is not between the bounds - * @deprecated will be removed in 7.0.0 + * @deprecated Use {@link PropertyFactory#longIntProperty(String)} */ + @Deprecated public LongProperty(String theName, String theDescription, String minStr, String maxStr, String defaultStr, float theUIOrder) { this(theName, theDescription, Long.valueOf(minStr), Long.valueOf(maxStr), @@ -57,7 +62,9 @@ public final class LongProperty extends AbstractNumericProperty { * @param theUIOrder UI order * * @throws IllegalArgumentException if {@literal min > max} or one of the defaults is not between the bounds + * @deprecated Use {@link PropertyFactory#longIntProperty(String)} */ + @Deprecated public LongProperty(String theName, String theDescription, Long min, Long max, Long theDefault, float theUIOrder) { this(theName, theDescription, min, max, theDefault, theUIOrder, false); } @@ -85,11 +92,15 @@ public final class LongProperty extends AbstractNumericProperty { } + /** @deprecated Use {@link PropertyFactory#longIntProperty(String)} */ + @Deprecated public static LongPBuilder named(String name) { return new LongPBuilder(name); } + /** @deprecated Use {@link PropertyFactory#longIntProperty(String)} */ + @Deprecated public static final class LongPBuilder extends SingleNumericPropertyBuilder { private LongPBuilder(String name) { super(name); diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/properties/LongPropertyTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/properties/LongPropertyTest.java index a35ce908db..878ec3f4c8 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/properties/LongPropertyTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/properties/LongPropertyTest.java @@ -10,6 +10,7 @@ import java.util.List; /** * @author Clément Fournier */ +@Deprecated public class LongPropertyTest extends AbstractNumericPropertyDescriptorTester { private static final long MIN = 10L;