SuperCSV does not support setting Java Bean fields that are not the exact type of the object that the outermost cell processor returns. In most cases this is merely an inconvenience and one may create a custom cell processor that returns an object of the correct type, but this is not an option for fields of an abstract/interface type.
Enclosing my suggestion for a fix. This modifies org.supercsv.util.MethodCache to replace Class.getMethod(...) with a new method getAnyAssignableMethod(...) that searches for any mutator that can take the type being set as an argument, but which will give preference to mutators whose type matches exactly.
Support for Java Bean field supertypes
org.supercsv.mock.SuperTypeFieldBean for tests
Attaching SuperTypeFieldBean, which I forgot. It's just a PersonBean but with CharSequence instead of Strings as field types.
Hi Thor
Sounds like an idea. I've looked at your code and it looks straight forward. I'm planning a releasing something within a month and will probably include your patch :)
cheers,
kasper
Thanks for the patch - I've just added this for the next release - see ReflectionUtils.findSetterWithCompatibleParamType().
For your effort, I've added you as a contributor in the pom :)