Hi all,
currently IConverterLocator#getConverter() declares a generic parameter <C>.
But very few places in Wicket call this method and even less benefit
from the generic return type.
Providing a custom converter for a component is rather clumsy:
public <C> IConverter<C> getConverter(Class<C> clazz)
{
if (Date.class.isAssignableFrom(clazz))
{
@SuppressWarnings("unchecked")
IConverter<C> result = (IConverter<C>)converter;
return result;
}
else
{
return super.getConverter(clazz);
}
}
Note that this code doesn't benefit at all from the generic parameter,
even worse the converter has to be cast and the unchecked warning has to
be suppressed.
I propose to remove the generic parameter from the method, that would
make it easier for user code to override this method.
WDYT?
Have fun
Sven