diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileVisitor.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileVisitor.java index 35c5b3723b..c450836a28 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileVisitor.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileVisitor.java @@ -7,10 +7,8 @@ package net.sourceforge.pmd.lang.apex.multifile; import java.util.Stack; import net.sourceforge.pmd.lang.apex.ast.ASTMethod; -import net.sourceforge.pmd.lang.apex.ast.ASTUserClass; import net.sourceforge.pmd.lang.apex.ast.ASTUserClassOrInterface; import net.sourceforge.pmd.lang.apex.ast.ASTUserEnum; -import net.sourceforge.pmd.lang.apex.ast.ASTUserInterface; import net.sourceforge.pmd.lang.apex.ast.ASTUserTrigger; import net.sourceforge.pmd.lang.apex.ast.ApexVisitorBase; @@ -56,14 +54,4 @@ public class ApexMultifileVisitor extends ApexVisitorBase { return data; } - @Override - public final Object visit(ASTUserInterface node, Object data) { - return visitTypeDecl(node, data); - } - - - @Override - public final Object visit(ASTUserClass node, Object data) { - return visitTypeDecl(node, data); - } } diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/AbstractNcssCountRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/AbstractNcssCountRule.java index 5c88f0ff53..13c00dce13 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/AbstractNcssCountRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/design/AbstractNcssCountRule.java @@ -26,6 +26,7 @@ import net.sourceforge.pmd.lang.apex.ast.ASTWhileLoopStatement; import net.sourceforge.pmd.lang.apex.ast.ApexNode; import net.sourceforge.pmd.lang.apex.ast.ApexVisitorBase; import net.sourceforge.pmd.lang.apex.rule.internal.AbstractCounterCheckRule; +import net.sourceforge.pmd.lang.ast.Node; /** * Abstract superclass for NCSS counting methods. Counts tokens according to @@ -65,13 +66,12 @@ public abstract class AbstractNcssCountRule> extends Abstr } @Override - protected Integer zero() { - return 0; - } - - @Override - protected Integer combine(Integer acc, Integer childValue) { - return acc + childValue; + protected Integer visitChildren(Node node, Void data) { + int v = 0; + for (Node child : node.children()) { + v += child.acceptVisitor(this, data); + } + return v; } /** diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptNode.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptNode.java index 1f240417bf..a31f250984 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptNode.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptNode.java @@ -6,11 +6,21 @@ package net.sourceforge.pmd.lang.ecmascript.ast; import org.mozilla.javascript.ast.AstNode; +import net.sourceforge.pmd.annotation.DeprecatedUntil700; import net.sourceforge.pmd.lang.ast.impl.GenericNode; public interface EcmascriptNode extends GenericNode> { + /** + * @deprecated See {@link EcmascriptParserVisitor} + */ + @Deprecated + @DeprecatedUntil700 + default Object jjtAccept(EcmascriptParserVisitor visitor, Object data) { + return acceptVisitor(visitor, data); + } + /** * Get the underlying Rhino AST node. * @deprecated The underlying Rhino node should not be used directly.