[#6058] StackOverflowError when DefaultBinding.pgFromString() encounters unknown type

This commit is contained in:
lukaseder 2017-04-11 14:42:15 +02:00
parent 8bd9d84106
commit 9dfe4f6b6c

View File

@ -2338,7 +2338,10 @@ public class DefaultBinding<T, U> implements Binding<T, U> {
else if (type == Object.class) {
return (T) string;
}
else {
// [#4964] [#6058] Recurse only if we have a meaningful converter, not the identity converter,
// which would cause a StackOverflowError, here!
else if (type != converter.fromType()) {
Converter<Object, T> c = (Converter<Object, T>) converter;
return c.from(pgFromString(c.fromType(), string));
}