Isolate single rule pattern

This commit is contained in:
Clément Fournier
2020-10-26 19:31:48 +01:00
parent ac864aa529
commit 6642f5d038
13 changed files with 41 additions and 46 deletions

View File

@@ -14,7 +14,6 @@ import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.RuleSet;
import net.sourceforge.pmd.RuleSets;
import net.sourceforge.pmd.RulesetsFactoryUtils;
import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
import net.sourceforge.pmd.lang.scala.ScalaLanguageModule;
@@ -38,7 +37,7 @@ public final class ScalaParsingHelper extends BaseParsingHelper<ScalaParsingHelp
Report report = new Report();
ctx.setReport(report);
ctx.setSourceCodeFile(new File("test.scala"));
RuleSet rules = RulesetsFactoryUtils.defaultFactory().createSingleRuleRuleSet(rule);
RuleSet rules = RuleSet.forSingleRule(rule);
try {
p.getSourceCodeProcessor().processSourceCode(new StringReader(testSourceCode), new RuleSets(rules), ctx);
} catch (PMDException e) {