From 02a98fb5bfb876ff3deafb346a0481f454f88422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 11 Aug 2020 14:10:20 +0200 Subject: [PATCH] Fix compil in modelica --- .../lang/modelica/resolver/ScopeAndDeclarationFinder.java | 2 +- .../pmd/lang/modelica/rule/AbstractModelicaRule.java | 7 ------- .../pmd/lang/modelica/resolver/ModelicaResolverTest.java | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ScopeAndDeclarationFinder.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ScopeAndDeclarationFinder.java index d1d7dc21bc..66a47e3cf9 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ScopeAndDeclarationFinder.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/resolver/ScopeAndDeclarationFinder.java @@ -68,7 +68,7 @@ public class ScopeAndDeclarationFinder extends ModelicaParserVisitorAdapter { } private Object cont(ModelicaNode node) { - super.visit(node, null); + super.visitModelicaNode(node, null); scopes.pop(); return null; } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java index 034ac2e2ea..a0b549c1dc 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/rule/AbstractModelicaRule.java @@ -28,13 +28,6 @@ public abstract class AbstractModelicaRule extends AbstractRule implements Model ((ModelicaNode) target).jjtAccept(this, ctx); } - @Override - public Object visit(ModelicaNode node, Object data) { - for (ModelicaNode child : node.children()) { - child.jjtAccept(this, data); - } - return data; - } @Override public boolean dependsOn(AstProcessingStage stage) { diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java index de0fc64f7c..69020917bf 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/resolver/ModelicaResolverTest.java @@ -31,12 +31,12 @@ public class ModelicaResolverTest { } @Override - public Object visit(ModelicaNode node, Object data) { + public Object visitModelicaNode(ModelicaNode node, Object data) { if (nodeClass.isInstance(node) && node.getImage().equals(nodeName)) { Assert.assertNull(result); result = node; } - return super.visit(node, data); + return super.visitModelicaNode(node, data); } ModelicaNode getResult() {