From 31ed6fd5651820f2223f04ee41f567c20bbb33a4 Mon Sep 17 00:00:00 2001 From: oowekyala Date: Sat, 15 Jul 2017 16:41:38 +0200 Subject: [PATCH] Removed overloads of setProperty --- .../pmd/AbstractPropertySource.java | 18 ++----------- .../net/sourceforge/pmd/PropertySource.java | 27 ++----------------- .../pmd/lang/rule/AbstractDelegateRule.java | 16 ++--------- 3 files changed, 6 insertions(+), 55 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertySource.java b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertySource.java index b6b297e3b8..da1ccf2127 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertySource.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertySource.java @@ -133,23 +133,9 @@ public abstract class AbstractPropertySource implements PropertySource { @Override - public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value) { + public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V... values) { checkValidPropertyDescriptor(propertyDescriptor); - propertyValuesByDescriptor.put(propertyDescriptor, Collections.singletonList(value)); - } - - - @Override - public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value1, V value2) { - checkValidPropertyDescriptor(propertyDescriptor); - propertyValuesByDescriptor.put(propertyDescriptor, Collections.unmodifiableList(Arrays.asList(value1, value2))); - } - - - @Override - public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value1, V value2, V... values) { - checkValidPropertyDescriptor(propertyDescriptor); - propertyValuesByDescriptor.put(propertyDescriptor, Collections.unmodifiableList(Arrays.asList(value1, value2, values))); + propertyValuesByDescriptor.put(propertyDescriptor, Collections.unmodifiableList(Arrays.asList(values))); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PropertySource.java b/pmd-core/src/main/java/net/sourceforge/pmd/PropertySource.java index 836d26b328..83001ce51e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PropertySource.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PropertySource.java @@ -66,37 +66,14 @@ public interface PropertySource { void setProperty(PropertyDescriptor propertyDescriptor, T value); - /** - * Sets the value of a multi value property descriptor with only one argument. - * - * @param propertyDescriptor The property descriptor for which to add a value - * @param value Value - * @param The type of the values - */ - void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value); - - - /** - * Sets the value of a multi value property descriptor with two arguments. - * - * @param propertyDescriptor The property descriptor for which to add a value - * @param value1 First value - * @param value2 Second value - * @param The type of the values - */ - void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value1, V value2); - - /** * Sets the value of a multi value property descriptor with a variable number of arguments. * * @param propertyDescriptor The property descriptor for which to add a value - * @param value1 First value - * @param value2 Second value - * @param values Rest of the values + * @param values Values * @param The type of the values */ - void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value1, V value2, V... values); + void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V... values); /** diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java index 78727fc8d4..97386fdfe8 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/AbstractDelegateRule.java @@ -209,20 +209,8 @@ public abstract class AbstractDelegateRule implements Rule { @Override - public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value) { - rule.setProperty(propertyDescriptor, value); - } - - - @Override - public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value1, V value2) { - rule.setProperty(propertyDescriptor, value1, value2); - } - - - @Override - public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V value1, V value2, V... values) { - rule.setProperty(propertyDescriptor, value1, value2, values); + public void setProperty(MultiValuePropertyDescriptor propertyDescriptor, V... values) { + rule.setProperty(propertyDescriptor, values); }