diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/AbstractMultiValueProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/AbstractMultiValueProperty.java index 0f46d52cb8..e37b9e0112 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/AbstractMultiValueProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/AbstractMultiValueProperty.java @@ -13,6 +13,7 @@ import java.util.regex.Pattern; import net.sourceforge.pmd.MultiValuePropertyDescriptor; import net.sourceforge.pmd.PropertyDescriptorField; import net.sourceforge.pmd.Rule; +import net.sourceforge.pmd.util.StringUtil; /** * Multi-valued property. @@ -176,11 +177,15 @@ import net.sourceforge.pmd.Rule; @Override public List valueFrom(String valueString) throws IllegalArgumentException { + if (StringUtil.isEmpty(valueString)) { + return Collections.emptyList(); + } + String[] strValues = valueString.split(Pattern.quote("" + multiValueDelimiter())); List values = new ArrayList<>(strValues.length); - for (int i = 0; i < strValues.length; i++) { - values.add(createFrom(strValues[i])); + for (String strValue : strValues) { + values.add(createFrom(strValue)); } return values;