diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/MultiValuePropertyBuilder.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/MultiValuePropertyBuilder.java index e3be94eac2..6405dd5770 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/MultiValuePropertyBuilder.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/MultiValuePropertyBuilder.java @@ -4,7 +4,9 @@ package net.sourceforge.pmd.properties.builders; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.List; import net.sourceforge.pmd.properties.MultiValuePropertyDescriptor; @@ -36,8 +38,8 @@ public abstract class MultiValuePropertyBuilder val) { - this.defaultValues = val; + public T defaultValues(Collection val) { + this.defaultValues = new ArrayList<>(val); return (T) this; } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/SinglePackagedPropertyBuilder.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/SinglePackagedPropertyBuilder.java index 3fb0b755bf..2f7219d14c 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/SinglePackagedPropertyBuilder.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/builders/SinglePackagedPropertyBuilder.java @@ -5,6 +5,7 @@ package net.sourceforge.pmd.properties.builders; import java.util.Arrays; +import java.util.Collection; /** @@ -22,12 +23,35 @@ public abstract class SinglePackagedPropertyBuilder packs) { + if (packs != null) { + this.legalPackageNames = packs.toArray(new String[0]); + } + return (T) this; + } + }