Removed choices from EnumeratedPropertyDescriptor
This commit is contained in:
@@ -24,12 +24,4 @@ public interface EnumeratedPropertyDescriptor<E, T> extends PropertyDescriptor<T
|
||||
*/
|
||||
Map<String, E> mappings();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a set of choice tuples if available. This is kept for compatibility with the eclipse plugin, even
|
||||
* though it returns the same information as {@link #mappings()} (only it returns them ordered).
|
||||
*
|
||||
* @return An array of the label value mappings. The first column is the labels, the second is the value.
|
||||
*/
|
||||
Object[][] choices();
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.sourceforge.pmd.EnumeratedPropertyDescriptor;
|
||||
import net.sourceforge.pmd.PropertyDescriptorFactory;
|
||||
@@ -114,18 +113,6 @@ public final class EnumeratedMultiProperty<E> extends AbstractMultiValueProperty
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object[][] choices() {
|
||||
Object[][] res = new Object[choicesByLabel.size()][2];
|
||||
int i = 0;
|
||||
for (Entry<String, E> e : choicesByLabel.entrySet()) {
|
||||
res[i++][0] = e.getKey();
|
||||
res[i][1] = e.getValue();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<E> type() {
|
||||
return valueType;
|
||||
|
@@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.rule.properties;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.sourceforge.pmd.EnumeratedPropertyDescriptor;
|
||||
import net.sourceforge.pmd.PropertyDescriptorFactory;
|
||||
@@ -111,17 +110,6 @@ public final class EnumeratedProperty<E> extends AbstractSingleValueProperty<E>
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object[][] choices() {
|
||||
Object[][] res = new Object[choicesByLabel.size()][2];
|
||||
int i = 0;
|
||||
for (Entry<String, E> e : choicesByLabel.entrySet()) {
|
||||
res[i++][0] = e.getKey();
|
||||
res[i][1] = e.getValue();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
/* default */ PropertyDescriptorWrapper<E> getWrapper() {
|
||||
return new EnumeratedPropertyDescriptorWrapper<>(this);
|
||||
|
@@ -25,9 +25,4 @@ import net.sourceforge.pmd.EnumeratedPropertyDescriptor;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object[][] choices() {
|
||||
return ((EnumeratedPropertyDescriptor<E, T>) propertyDescriptor).choices();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user