forked from phoedos/pmd
Merge pull request #4951 from adangel/compat-maven-pmd-plugin-3.22.0
[compat6] Make compat6 forward compatible with maven-pmd-plugin 3.22.0
This commit is contained in:
@ -346,6 +346,9 @@ public class PMDConfiguration extends AbstractConfiguration {
|
||||
this.minimumPriority = minimumPriority;
|
||||
}
|
||||
|
||||
public void setMinimumPriority(net.sourceforge.pmd.lang.rule.RulePriority mininumPriority) {
|
||||
this.minimumPriority = RulePriority.valueOf(mininumPriority.name());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Renderer instance based upon the configured reporting options.
|
||||
|
@ -49,10 +49,10 @@ import net.sourceforge.pmd.util.BaseResultProducingCloseable;
|
||||
public class Report {
|
||||
// todo move to package reporting
|
||||
|
||||
private final List<RuleViolation> violations = synchronizedList(new ArrayList<>());
|
||||
private final List<SuppressedViolation> suppressedRuleViolations = synchronizedList(new ArrayList<>());
|
||||
private final List<ProcessingError> errors = synchronizedList(new ArrayList<>());
|
||||
private final List<ConfigurationError> configErrors = synchronizedList(new ArrayList<>());
|
||||
protected final List<RuleViolation> violations = synchronizedList(new ArrayList<>());
|
||||
protected final List<SuppressedViolation> suppressedRuleViolations = synchronizedList(new ArrayList<>());
|
||||
protected final List<ProcessingError> errors = synchronizedList(new ArrayList<>());
|
||||
protected final List<ConfigurationError> configErrors = synchronizedList(new ArrayList<>());
|
||||
|
||||
@DeprecatedUntil700
|
||||
@InternalApi
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
package net.sourceforge.pmd.reporting;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.sourceforge.pmd.Rule;
|
||||
import net.sourceforge.pmd.lang.document.FileId;
|
||||
|
||||
@ -45,4 +47,20 @@ public class Report extends net.sourceforge.pmd.Report {
|
||||
|
||||
public static final class ReportBuilderListener extends net.sourceforge.pmd.Report.ReportBuilderListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Report filterViolations(Predicate<net.sourceforge.pmd.RuleViolation> filter) {
|
||||
Report copy = new Report();
|
||||
|
||||
for (net.sourceforge.pmd.RuleViolation violation : violations) {
|
||||
if (filter.test(violation)) {
|
||||
copy.addRuleViolation(violation);
|
||||
}
|
||||
}
|
||||
|
||||
copy.suppressedRuleViolations.addAll(suppressedRuleViolations);
|
||||
copy.errors.addAll(errors);
|
||||
copy.configErrors.addAll(configErrors);
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user