Fix deprecated API usage
Fixes in pmd-doc, html, javascript, jsp, modelica, objectivec, scala, swift, vm
This commit is contained in:
@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.scala.rule;
|
||||
import net.sourceforge.pmd.RuleContext;
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.rule.AbstractRule;
|
||||
import net.sourceforge.pmd.lang.scala.ast.ScalaNode;
|
||||
import net.sourceforge.pmd.lang.scala.ast.ScalaParserVisitor;
|
||||
|
||||
/**
|
||||
@ -18,7 +17,7 @@ public class ScalaRule extends AbstractRule implements ScalaParserVisitor<RuleCo
|
||||
|
||||
@Override
|
||||
public void apply(Node target, RuleContext ctx) {
|
||||
((ScalaNode<?>) target).accept(this, ctx);
|
||||
target.acceptVisitor(this, ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,12 +47,12 @@ class ScalaRuleTest extends BaseScalaTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuleContext visit(ASTTermApply node, RuleContext data) {
|
||||
ASTTermName child = node.getFirstChildOfType(ASTTermName.class);
|
||||
public RuleContext visit(ASTTermApply node, RuleContext ruleContext) {
|
||||
ASTTermName child = node.firstChild(ASTTermName.class);
|
||||
if (child != null && child.hasImageEqualTo("println")) {
|
||||
addViolation(data, node);
|
||||
ruleContext.addViolation(node);
|
||||
}
|
||||
return data;
|
||||
return ruleContext;
|
||||
}
|
||||
};
|
||||
Report report = scala.executeRuleOnResource(rule, SCALA_TEST);
|
||||
|
Reference in New Issue
Block a user