@Override
public void setSelectedItem(Object item) {
+ if (item == null) {
+ // Clear selection - huh?
+ return;
+ }
if (item instanceof String) {
if (currentValue != null)
setMethod.invoke(source, (Object)null);
}
if (!(item instanceof Enum<?>)) {
- throw new IllegalArgumentException("Not String or Enum");
+ throw new IllegalArgumentException("Not String or Enum, item="+item);
}
// Comparison with == ok, since both are enums