diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 3993c84a4c..42b1b7703d 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -65,10 +65,6 @@ - - org.antlr - antlr4-runtime - net.sourceforge.pmd pmd-core diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java index 9a7fd3eae8..886c279315 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTClassDefinition.java @@ -11,11 +11,11 @@ public class ASTClassDefinition extends AbstractModelicaNode { private ModelicaClassSpecialization specialization; private ModelicaClassSpecifierNode specifier; - public ASTClassDefinition(int id) { + ASTClassDefinition(int id) { super(id); } - public ASTClassDefinition(ModelicaParser p, int id) { + ASTClassDefinition(ModelicaParser p, int id) { super(p, id); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java index 52831570c4..b25bb493c6 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTElementList.java @@ -7,11 +7,11 @@ package net.sourceforge.pmd.lang.modelica.ast; public class ASTElementList extends AbstractModelicaNode { private Visibility visibility; - public ASTElementList(int id) { + ASTElementList(int id) { super(id); } - public ASTElementList(ModelicaParser p, int id) { + ASTElementList(ModelicaParser p, int id) { super(p, id); } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java index 886c7ec9c1..247d400c2b 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ast/ASTStoredDefinition.java @@ -4,12 +4,13 @@ package net.sourceforge.pmd.lang.modelica.ast; +import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.modelica.resolver.CompositeName; /** * A representation of a Modelica source code file. */ -public class ASTStoredDefinition extends AbstractModelicaNode { +public class ASTStoredDefinition extends AbstractModelicaNode implements RootNode { private boolean hasBOM = false; ASTStoredDefinition(int id) { diff --git a/pmd-modelica/src/main/resources/category/modelica/bestpractices.xml b/pmd-modelica/src/main/resources/category/modelica/bestpractices.xml index d121417e26..fb1bcfde9e 100644 --- a/pmd-modelica/src/main/resources/category/modelica/bestpractices.xml +++ b/pmd-modelica/src/main/resources/category/modelica/bestpractices.xml @@ -11,6 +11,7 @@ Rules which enforce generally accepted best practices. Having a class starting with some name and some *different* @@ -27,27 +28,82 @@ Rules which enforce generally accepted best practices. + + + Modelica specification requires passing connectors to the `connect` clause, while some implementations tolerate using it on plain variables, etc.. 2 + + + There is multiple candidates for this type resolution. While generally this is not an error, this may indicate a bug. 3 + + + \ No newline at end of file diff --git a/pmd-modelica/src/test/resources/net/sourceforge/pmd/lang/modelica/rule/bestpractices/xml/AmbiguousResolution.xml b/pmd-modelica/src/test/resources/net/sourceforge/pmd/lang/modelica/rule/bestpractices/xml/AmbiguousResolution.xml index 1e758660c9..fd017e05a7 100644 --- a/pmd-modelica/src/test/resources/net/sourceforge/pmd/lang/modelica/rule/bestpractices/xml/AmbiguousResolution.xml +++ b/pmd-modelica/src/test/resources/net/sourceforge/pmd/lang/modelica/rule/bestpractices/xml/AmbiguousResolution.xml @@ -40,7 +40,7 @@ end Test; ]]> - Invalid example: class Y is both placed to the scope by extending and import + Invalid example: class Y is imported twice 1 -