Merge branch 'pmd6-improve-pmd-analysis' into pmd7-merge-master

This commit is contained in:
Clément Fournier committed 2022-03-05 17:21:49 +01:00
commit 6004f99348
2 files changed
+5 -2

No files matched your search

@@ -405,9 +405,9 @@ public class PMDConfiguration extends AbstractConfiguration {
@DeprecatedUntil700
public void setRuleSets(@Nullable String ruleSets) {
if (ruleSets == null) {
this.ruleSets.clear();
this.ruleSets= new ArrayList<>();
} else {
this.ruleSets = Arrays.asList(ruleSets.split(","));
this.ruleSets = new ArrayList<>(Arrays.asList(ruleSets.split(",")));
}
}
@@ -136,6 +136,9 @@ public class PmdConfigurationTest {
assertEquals(listOf("/rulesets/basic.xml", "foo.xml"), configuration.getRuleSetPaths());
configuration.setRuleSets(Collections.<String>emptyList());
assertThat(configuration.getRuleSetPaths(), empty());
// should be addable even though we set it to an unmodifiable empty list
configuration.addRuleSet("foo.xml");
assertEquals(listOf("foo.xml"), configuration.getRuleSetPaths());
}
@Test