Deprecate RuleViolation impls

This commit is contained in:
Clément Fournier
2019-12-05 15:26:03 +01:00
parent eb6ceef085
commit b1ba962ddf
4 changed files with 17 additions and 1 deletions

View File

@ -6,6 +6,8 @@ package net.sourceforge.pmd.lang.apex.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.apex.ast.CanSuppressWarnings;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.rule.ParametricRuleViolation;
@ -21,8 +23,12 @@ import net.sourceforge.pmd.lang.rule.ParametricRuleViolation;
* <li>Suppression indicator</li>
* </ul>
* @param <T>
*
* @deprecated See {@link RuleViolation}
*/
@SuppressWarnings("PMD.UseUtilityClass") // we inherit non-static methods...
@Deprecated
@InternalApi
public class ApexRuleViolation<T> extends ParametricRuleViolation<Node> {
public ApexRuleViolation(Rule rule, RuleContext ctx, Node node, String message, int beginLine, int endLine) {

View File

@ -6,7 +6,11 @@ package net.sourceforge.pmd;
/**
* A RuleViolation is created by a Rule when it identifies a violation of the
* Rule constraints.
* Rule constraints. RuleViolations are simple data holders that are collected
* into a {@link Report}.
*
* <p>Since PMD 6.21.0, implementations of this interface are considered internal
* API and hence deprecated. Clients should exclusively use this interface.
*
* @see Rule
*/

View File

@ -9,6 +9,7 @@ import java.util.Set;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration;
@ -37,7 +38,9 @@ import net.sourceforge.pmd.lang.symboltable.Scope;
* <li>Variable name</li>
* <li>Suppression indicator</li>
* </ul>
* @deprecated See {@link RuleViolation}
*/
@Deprecated
public class JavaRuleViolation extends ParametricRuleViolation<JavaNode> {
public JavaRuleViolation(Rule rule, RuleContext ctx, JavaNode node, String message, int beginLine, int endLine) {

View File

@ -6,6 +6,7 @@ package net.sourceforge.pmd.lang.java.rule.errorprone;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.JavaNode;
import net.sourceforge.pmd.lang.java.rule.JavaRuleViolation;
@ -16,7 +17,9 @@ import net.sourceforge.pmd.lang.java.rule.JavaRuleViolation;
*
* @author Sven Jacob
* @author Brian Remedios
* @deprecated See {@link RuleViolation}
*/
@Deprecated
public class DaaRuleViolation extends JavaRuleViolation {
private final String variableName;