diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/ApexRuleViolationFactory.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/ApexRuleViolationFactory.java index 40adaf5c9b..2d155fa0cf 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/ApexRuleViolationFactory.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/ApexRuleViolationFactory.java @@ -16,9 +16,9 @@ import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.apex.ast.CanSuppressWarnings; import net.sourceforge.pmd.lang.ast.Node; -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; -public final class ApexRuleViolationFactory extends AbstractRuleViolationFactory { +public final class ApexRuleViolationFactory extends DefaultRuleViolationFactory { public static final ApexRuleViolationFactory INSTANCE = new ApexRuleViolationFactory(); private static final ViolationSuppressor APEX_ANNOT_SUPPRESSOR = new ViolationSuppressor() { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java index a730f06c64..7656ca42c4 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java @@ -9,9 +9,10 @@ import java.util.List; import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.ast.AstProcessingStage; +import net.sourceforge.pmd.lang.ast.xpath.DefaultASTXPathHandler; import net.sourceforge.pmd.lang.dfa.DFAGraphRule; import net.sourceforge.pmd.lang.metrics.LanguageMetricsProvider; -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; import net.sourceforge.pmd.lang.rule.RuleViolationFactory; @@ -31,7 +32,9 @@ public interface LanguageVersionHandler { /** * Get the XPathHandler. */ - XPathHandler getXPathHandler(); + default XPathHandler getXPathHandler() { + return new DefaultASTXPathHandler(); + } /** @@ -63,7 +66,7 @@ public interface LanguageVersionHandler { * Get the RuleViolationFactory. */ default RuleViolationFactory getRuleViolationFactory() { - return new AbstractRuleViolationFactory() {}; + return DefaultRuleViolationFactory.defaultInstance(); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/DefaultRuleViolationFactory.java similarity index 91% rename from pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java rename to pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/DefaultRuleViolationFactory.java index 9526056375..12fd5b9a1c 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/DefaultRuleViolationFactory.java @@ -26,13 +26,13 @@ import net.sourceforge.pmd.lang.ast.Node; * It may be extended to add more suppression options. * *

Implementations should be internal. Only the interface should be exposed. - * - * TODO this should not be an abstract class anymore */ -public abstract class AbstractRuleViolationFactory implements RuleViolationFactory { +public class DefaultRuleViolationFactory implements RuleViolationFactory { private static final Object[] NO_ARGS = new Object[0]; + private static final DefaultRuleViolationFactory DEFAULT = new DefaultRuleViolationFactory(); + private String cleanup(String message, Object[] args) { if (message != null) { @@ -45,7 +45,6 @@ public abstract class AbstractRuleViolationFactory implements RuleViolationFacto } } - // TODO why do we need those two overloads?? @Override public void addViolation(RuleContext ruleContext, Rule rule, Node node, String message, Object[] args) { @@ -101,4 +100,9 @@ public abstract class AbstractRuleViolationFactory implements RuleViolationFacto rv.setLines(beginLine, endLine); return rv; } + + /** Returns the default instance (no additional suppressors, creates a ParametricRuleViolation). */ + public static RuleViolationFactory defaultInstance() { + return DEFAULT; + } } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java index faca92e3cc..6b6ff96177 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/AbstractRuleTest.java @@ -20,9 +20,9 @@ import net.sourceforge.pmd.lang.DummyLanguageModule; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.ast.DummyNode; import net.sourceforge.pmd.lang.ast.DummyRoot; -import net.sourceforge.pmd.lang.ast.DummyRuleViolationFactory; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.AbstractRule; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.properties.PropertyDescriptor; import net.sourceforge.pmd.properties.PropertyFactory; @@ -128,7 +128,7 @@ public class AbstractRuleTest { ctx.setSourceCodeFile(new File("filename")); DummyRoot n = new DummyRoot(m); n.setCoords(5, 1, 6, 0); - DummyRuleViolationFactory.INSTANCE.addViolation(ctx, r, n, "specificdescription", new Object[0]); + DefaultRuleViolationFactory.defaultInstance().addViolation(ctx, r, n, "specificdescription", new Object[0]); assertTrue(ctx.getReport().isEmpty()); } diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java index 888a46487a..fcd0908637 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/DummyLanguageModule.java @@ -19,7 +19,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor; -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; /** @@ -93,7 +93,7 @@ public class DummyLanguageModule extends BaseLanguageModule { } } - public static class RuleViolationFactory extends AbstractRuleViolationFactory { + public static class RuleViolationFactory extends DefaultRuleViolationFactory { @Override protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message) { return createRuleViolation(rule, ruleContext, node, message, 0, 0); @@ -103,6 +103,7 @@ public class DummyLanguageModule extends BaseLanguageModule { protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message, int beginLine, int endLine) { ParametricRuleViolation rv = new ParametricRuleViolation(rule, ruleContext, node, message) { + @Override public String getPackageName() { this.packageName = "foo"; // just for testing variable expansion return super.getPackageName(); diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyRuleViolationFactory.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyRuleViolationFactory.java deleted file mode 100644 index eee52c46f9..0000000000 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyRuleViolationFactory.java +++ /dev/null @@ -1,12 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.ast; - -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; - -public class DummyRuleViolationFactory extends AbstractRuleViolationFactory { - - public static final DummyRuleViolationFactory INSTANCE = new DummyRuleViolationFactory(); -} diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactoryTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/DefaultRuleViolationFactoryTest.java similarity index 90% rename from pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactoryTest.java rename to pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/DefaultRuleViolationFactoryTest.java index 168bf43f00..5678e964b8 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactoryTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/DefaultRuleViolationFactoryTest.java @@ -14,9 +14,9 @@ import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.lang.ast.Node; -public class AbstractRuleViolationFactoryTest { +public class DefaultRuleViolationFactoryTest { private RuleContext ruleContext; - private RuleViolationFactory factory; + private RuleViolationFactory factory = DefaultRuleViolationFactory.defaultInstance(); private static class TestRule extends AbstractRule { @Override @@ -28,9 +28,8 @@ public class AbstractRuleViolationFactoryTest { @Before public void setup() { ruleContext = new RuleContext(); - factory = new AbstractRuleViolationFactory() {}; } - + @Test public void testMessage() { factory.addViolation(ruleContext, new TestRule(), null, "message with \"'{'\"", null); diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java index bb8be02b3b..a0ede06287 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/renderers/SummaryHTMLRendererTest.java @@ -19,7 +19,7 @@ import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.ReportTest; import net.sourceforge.pmd.RuleContext; import net.sourceforge.pmd.lang.ast.DummyRoot; -import net.sourceforge.pmd.lang.ast.DummyRuleViolationFactory; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; public class SummaryHTMLRendererTest extends AbstractRendererTst { @@ -93,7 +93,7 @@ public class SummaryHTMLRendererTest extends AbstractRendererTst { + "file" + PMD.EOL + "

" + error.getDetail() + "
" + PMD.EOL + "" + PMD.EOL + "" + PMD.EOL; } - + @Override public String getExpectedError(ConfigurationError error) { return "PMD" + PMD.EOL + "

Summary

" + PMD.EOL @@ -146,7 +146,7 @@ public class SummaryHTMLRendererTest extends AbstractRendererTst { RuleContext ctx = new RuleContext(); DummyRoot root = new DummyRoot(suppressions); root.setCoords(1, 10, 4, 5); - DummyRuleViolationFactory.INSTANCE.addViolation(ctx, new FooRule(), root, "suppress test", 1, 1, new Object[0]); + DefaultRuleViolationFactory.defaultInstance().addViolation(ctx, new FooRule(), root, "suppress test", 1, 1, new Object[0]); return ctx.getReport(); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolationFactory.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolationFactory.java index 2fcdfe1b18..2432cc4cb3 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolationFactory.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/JavaRuleViolationFactory.java @@ -17,10 +17,10 @@ import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.ViolationSuppressor; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.JavaNode; -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; import net.sourceforge.pmd.lang.rule.RuleViolationFactory; -public final class JavaRuleViolationFactory extends AbstractRuleViolationFactory { +public final class JavaRuleViolationFactory extends DefaultRuleViolationFactory { public static final RuleViolationFactory INSTANCE = new JavaRuleViolationFactory(); private static final ViolationSuppressor JAVA_ANNOT_SUPPRESSOR = new ViolationSuppressor() { diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/Ecmascript3Handler.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/Ecmascript3Handler.java index ed522cf505..9a6fd84912 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/Ecmascript3Handler.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/Ecmascript3Handler.java @@ -7,26 +7,12 @@ package net.sourceforge.pmd.lang.ecmascript; import net.sourceforge.pmd.lang.AbstractPmdLanguageVersionHandler; import net.sourceforge.pmd.lang.Parser; import net.sourceforge.pmd.lang.ParserOptions; -import net.sourceforge.pmd.lang.XPathHandler; -import net.sourceforge.pmd.lang.ast.xpath.DefaultASTXPathHandler; -import net.sourceforge.pmd.lang.ecmascript.rule.EcmascriptRuleViolationFactory; -import net.sourceforge.pmd.lang.rule.RuleViolationFactory; /** * Implementation of LanguageVersionHandler for the ECMAScript Version 3. */ public class Ecmascript3Handler extends AbstractPmdLanguageVersionHandler { - @Override - public XPathHandler getXPathHandler() { - return new DefaultASTXPathHandler(); - } - - @Override - public RuleViolationFactory getRuleViolationFactory() { - return EcmascriptRuleViolationFactory.INSTANCE; - } - @Override public ParserOptions getDefaultParserOptions() { return new EcmascriptParserOptions(); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java index 219ed2577b..d3786e9a8b 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java @@ -5,6 +5,7 @@ package net.sourceforge.pmd.lang.ecmascript; import net.sourceforge.pmd.lang.BaseLanguageModule; +import net.sourceforge.pmd.lang.LanguageVersionHandler; import net.sourceforge.pmd.lang.ecmascript.rule.EcmascriptRuleChainVisitor; /** @@ -12,12 +13,17 @@ import net.sourceforge.pmd.lang.ecmascript.rule.EcmascriptRuleChainVisitor; */ public class EcmascriptLanguageModule extends BaseLanguageModule { + private static final Ecmascript3Handler DEFAULT = new Ecmascript3Handler(); + public static final String NAME = "Ecmascript"; public static final String TERSE_NAME = "ecmascript"; public EcmascriptLanguageModule() { super(NAME, null, TERSE_NAME, EcmascriptRuleChainVisitor.class, "js"); - addVersion("3", new Ecmascript3Handler(), true); + addVersion("3", DEFAULT, true); } + public static LanguageVersionHandler defaultHandler() { + return DEFAULT; + } } diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/EcmascriptRuleViolationFactory.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/EcmascriptRuleViolationFactory.java deleted file mode 100644 index 1648c02757..0000000000 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/EcmascriptRuleViolationFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.ecmascript.rule; - -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; - -public final class EcmascriptRuleViolationFactory extends AbstractRuleViolationFactory { - - public static final EcmascriptRuleViolationFactory INSTANCE = new EcmascriptRuleViolationFactory(); - - private EcmascriptRuleViolationFactory() { - } -} diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java index 292cb9d1f6..3dbfa975f0 100644 --- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java +++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java @@ -13,7 +13,6 @@ import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; import net.sourceforge.pmd.lang.ecmascript.ast.ASTFunctionNode; import net.sourceforge.pmd.lang.ecmascript.rule.AbstractEcmascriptRule; -import net.sourceforge.pmd.lang.ecmascript.rule.EcmascriptRuleViolationFactory; import net.sourceforge.pmd.testframework.RuleTst; public class ReportTest extends RuleTst { @@ -24,7 +23,7 @@ public class ReportTest extends RuleTst { Rule rule = new AbstractEcmascriptRule() { @Override public Object visit(ASTFunctionNode node, Object data) { - EcmascriptRuleViolationFactory.INSTANCE.addViolation((RuleContext) data, this, node, "Test", null); + EcmascriptLanguageModule.defaultHandler().getRuleViolationFactory().addViolation((RuleContext) data, this, node, "Test", null); return super.visit(node, data); } }; diff --git a/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageHandler.java b/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageHandler.java index 06cb3616b0..1a37bb0781 100644 --- a/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageHandler.java +++ b/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageHandler.java @@ -6,8 +6,6 @@ package net.sourceforge.pmd.lang.scala; import net.sourceforge.pmd.lang.AbstractPmdLanguageVersionHandler; import net.sourceforge.pmd.lang.ParserOptions; -import net.sourceforge.pmd.lang.rule.RuleViolationFactory; -import net.sourceforge.pmd.lang.scala.rule.ScalaRuleViolationFactory; import scala.meta.Dialect; @@ -20,7 +18,7 @@ public class ScalaLanguageHandler extends AbstractPmdLanguageVersionHandler { /** * Create the Language Handler using the given Scala Dialect. - * + * * @param scalaDialect * the language version to use while parsing etc */ @@ -30,17 +28,13 @@ public class ScalaLanguageHandler extends AbstractPmdLanguageVersionHandler { /** * Get the Scala Dialect used in this language version choice. - * + * * @return the Scala Dialect for this handler */ public Dialect getDialect() { return this.dialect; } - @Override - public RuleViolationFactory getRuleViolationFactory() { - return ScalaRuleViolationFactory.INSTANCE; - } @Override public ScalaParser getParser(ParserOptions parserOptions) { diff --git a/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleViolationFactory.java b/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleViolationFactory.java deleted file mode 100644 index 73ec26099e..0000000000 --- a/pmd-scala/src/main/java/net/sourceforge/pmd/lang/scala/rule/ScalaRuleViolationFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.scala.rule; - -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.rule.AbstractRuleViolationFactory; -import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; -import net.sourceforge.pmd.lang.rule.RuleViolationFactory; - -/** - * A RuleViolationFactory for Scala. - */ -public class ScalaRuleViolationFactory extends AbstractRuleViolationFactory { - /** - * The shared singleton of this RuleViolationFactory. - */ - public static final RuleViolationFactory INSTANCE = new ScalaRuleViolationFactory(); - - @Override - protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message) { - return new ParametricRuleViolation(rule, ruleContext, node, message); - } - - @Override - protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message, - int beginLine, int endLine) { - ParametricRuleViolation rv = new ParametricRuleViolation<>(rule, ruleContext, node, message); - rv.setLines(beginLine, endLine); - return rv; - } - -} diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java index 0e96451db1..6757f252f5 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java @@ -7,9 +7,7 @@ package net.sourceforge.pmd.test.lang; import java.io.Reader; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; -import java.util.Map; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleContext; @@ -24,7 +22,7 @@ import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor; -import net.sourceforge.pmd.lang.rule.AbstractRuleViolationFactory; +import net.sourceforge.pmd.lang.rule.DefaultRuleViolationFactory; import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.test.lang.ast.DummyNode; @@ -94,15 +92,7 @@ public class DummyLanguageModule extends BaseLanguageModule { } } - private static class DummyRootNode extends DummyNode implements RootNode { - - DummyRootNode(int id) { - super(id); - } - - } - - public static class RuleViolationFactory extends AbstractRuleViolationFactory { + public static class RuleViolationFactory extends DefaultRuleViolationFactory { @Override protected RuleViolation createRuleViolation(Rule rule, RuleContext ruleContext, Node node, String message) { return createRuleViolation(rule, ruleContext, node, message, 0, 0);