jspoon icon indicating copy to clipboard operation
jspoon copied to clipboard

Custom converter validation failures

Open cr3ativ3 opened this issue 8 years ago • 0 comments

HtmlFieldWithConverter.class has the following code to check the declared converter:

if (converterClass.equals(ElementConverter.class)){
    throw new IllegalArgumentException("Expecting a concrete type of " + ElementConverter.class);
}

But that fails to catch any case where interface InterfaceConverter<T> extends ElementConverter<T> that results in either

pl.droidsonroids.jspoon.exception.ConstructorNotFoundException: Default constructor for class EmptyConverter not found.
	at pl.droidsonroids.jspoon.Utils.constructInstance(Utils.java:46)
        ...

or abstract class AbstractConverter<T> implements ElementConverter<T> throws

pl.droidsonroids.jspoon.exception.ObjectCreationException: Error while creating instance of InterfaceConverter.
	at pl.droidsonroids.jspoon.Utils.constructInstance(Utils.java:48)
        ...

cr3ativ3 avatar Mar 22 '18 17:03 cr3ativ3