diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 78259a13a2..ac7b4e1bfc 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -53,6 +53,8 @@ AbstractTokenizer and the custom tokenizers of Fortran, Perl and Ruby are deprec * {% jdoc !!fortran::cpd.FortranTokenizer %}. Was replaced by an {% jdoc core::cpd.AnyTokenizer %}. Use {% jdoc !!fortran::cpd.FortranLanguage#getTokenizer() %} anyway. * {% jdoc !!perl::cpd.PerlTokenizer %}. Was replaced by an {% jdoc core::cpd.AnyTokenizer %}. Use {% jdoc !!perl::cpd.PerlLanguage#getTokenizer() %} anyway. * {% jdoc !!ruby::cpd.RubyTokenizer %}. Was replaced by an {% jdoc core::cpd.AnyTokenizer %}. Use {% jdoc !!ruby::cpd.RubyLanguage#getTokenizer() %} anyway. +* {% jdoc !!core::lang.rule.RuleReference#getOverriddenLanguage() %} and + {% jdoc !!core::lang.rule.RuleReference#setLanguage(net.sourceforge.pmd.lang.Language) %} ### External Contributions diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java index 29dec60d4c..4d3582010b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/RuleReference.java @@ -86,13 +86,21 @@ public class RuleReference extends AbstractDelegateRule { this.setRule(ref.getRule().deepCopy()); } + /** + * @deprecated overriding the language of a rule is not supported. + */ + @Deprecated public Language getOverriddenLanguage() { return language; } + /** + * @deprecated overriding the language of a rule is not supported. + */ // FIXME should we really allow overriding the language of a rule? // I don't see any case where this wouldn't just make the rule fail during execution @Override + @Deprecated public void setLanguage(Language language) { // Only override if different than current value, or if already // overridden.