|
19 | 19 |
|
20 | 20 | import java.io.File;
|
21 | 21 | import java.util.ArrayList;
|
| 22 | +import java.util.Collection; |
22 | 23 | import java.util.List;
|
23 | 24 | import java.util.Objects;
|
24 | 25 |
|
@@ -283,9 +284,9 @@ public class CleanthatJavaConfig {
|
283 | 284 |
|
284 | 285 | private String sourceJdk = CleanthatJavaStep.defaultSourceJdk();
|
285 | 286 |
|
286 |
| - private List<String> mutators = CleanthatJavaStep.defaultMutators(); |
| 287 | + private List<String> mutators = new ArrayList<>(CleanthatJavaStep.defaultMutators()); |
287 | 288 |
|
288 |
| - private List<String> excludedMutators = CleanthatJavaStep.defaultExcludedMutators(); |
| 289 | + private List<String> excludedMutators = new ArrayList<>(CleanthatJavaStep.defaultExcludedMutators()); |
289 | 290 |
|
290 | 291 | CleanthatJavaConfig() {
|
291 | 292 | addStep(createStep());
|
@@ -319,14 +320,20 @@ public CleanthatJavaConfig clearMutators() {
|
319 | 320 | return this;
|
320 | 321 | }
|
321 | 322 |
|
322 |
| - // The fully qualified name of a class implementing eu.solven.cleanthat.engine.java.refactorer.meta.IMutator |
323 |
| - // or '*' to include all default mutators |
| 323 | + // An id of a mutator (see IMutator.getIds()) or |
| 324 | + // tThe fully qualified name of a class implementing eu.solven.cleanthat.engine.java.refactorer.meta.IMutator |
324 | 325 | public CleanthatJavaConfig addMutator(String mutator) {
|
325 | 326 | this.mutators.add(mutator);
|
326 | 327 | replaceStep(createStep());
|
327 | 328 | return this;
|
328 | 329 | }
|
329 | 330 |
|
| 331 | + public CleanthatJavaConfig addMutators(Collection<String> mutators) { |
| 332 | + this.mutators.addAll(mutators); |
| 333 | + replaceStep(createStep()); |
| 334 | + return this; |
| 335 | + } |
| 336 | + |
330 | 337 | // useful to exclude a mutator amongst the default list of mutators
|
331 | 338 | public CleanthatJavaConfig excludeMutator(String mutator) {
|
332 | 339 | this.excludedMutators.add(mutator);
|
|
0 commit comments