From 75d197b592a5d841b092baedc58931b2466e2b7d Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 6 Nov 2020 16:39:22 +0100 Subject: [PATCH 1/2] [core] Add deprecations for ParametricRuleViolation and ParserOptions#suppressMarker --- docs/pages/release_notes.md | 2 ++ .../main/java/net/sourceforge/pmd/lang/ParserOptions.java | 4 ++++ .../sourceforge/pmd/lang/rule/ParametricRuleViolation.java | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 4f08b71536..4587ebc64f 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -38,6 +38,8 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr * {% jdoc !!javascript::lang.ecmascript.Ecmascript3Parser %} * {% jdoc !!javascript::lang.ecmascript.ast.EcmascriptParser#parserOptions %} * {% jdoc !!javascript::lang.ecmascript.ast.EcmascriptParser#getSuppressMap() %} +* {% jdoc !!core::lang.rule.ParametricRuleViolation %} +* {% jdoc !!core::lang.ParserOptions#suppressMarker %} ### External Contributions diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ParserOptions.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ParserOptions.java index e379d05e5f..1a5d5b20fc 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ParserOptions.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ParserOptions.java @@ -11,6 +11,10 @@ package net.sourceforge.pmd.lang; * {@link Object#hashCode()}. */ public class ParserOptions { + /** + * @deprecated Use {@link #getSuppressMarker()} instead. + */ + @Deprecated protected String suppressMarker; public String getSuppressMarker() { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/ParametricRuleViolation.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/ParametricRuleViolation.java index 2936a05b78..a41319dfac 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/ParametricRuleViolation.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/ParametricRuleViolation.java @@ -10,10 +10,16 @@ import java.util.regex.Pattern; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.util.StringUtil; +/** + * @deprecated This is internal. Clients should exclusively use {@link RuleViolation}. + */ +@Deprecated +@InternalApi public class ParametricRuleViolation implements RuleViolation { protected final Rule rule; From db404434b47c5886210b13aedbfd0b7704d9c056 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 6 Nov 2020 16:40:22 +0100 Subject: [PATCH 2/2] [modelica] Internalize ModelicaRuleViolationFactory This was missing, all other impls are internal api already --- docs/pages/release_notes.md | 1 + .../lang/modelica/rule/ModelicaRuleViolationFactory.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 4587ebc64f..abd3ee22d0 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -40,6 +40,7 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr * {% jdoc !!javascript::lang.ecmascript.ast.EcmascriptParser#getSuppressMap() %} * {% jdoc !!core::lang.rule.ParametricRuleViolation %} * {% jdoc !!core::lang.ParserOptions#suppressMarker %} +* {% jdoc !!modelica::lang.modelica.rule.ModelicaRuleViolationFactory %} ### External Contributions diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/ModelicaRuleViolationFactory.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/ModelicaRuleViolationFactory.java index 3015ad21d3..9bf3d623d8 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/ModelicaRuleViolationFactory.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/ModelicaRuleViolationFactory.java @@ -7,10 +7,17 @@ package net.sourceforge.pmd.lang.modelica.rule; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleViolation; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; +import net.sourceforge.pmd.lang.rule.RuleViolationFactory; +/** + * @deprecated See {@link RuleViolationFactory} + */ +@Deprecated +@InternalApi public final class ModelicaRuleViolationFactory extends AbstractRuleViolationFactory { public static final ModelicaRuleViolationFactory INSTANCE = new ModelicaRuleViolationFactory();