Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
DataBinder should use ConversionService if PropertyEditor cannot produce required type [SPR-13042] #17634
When there is PropertyEditor registered for String, TypeConverterDelegate uses it to convert from every possible class... to String:
Thus, it doesn't even try to use custom ConversionService:
It makes no sense. IMHO, TypeConverterDelegate should use editors registered for types other than String (for instance, where there is PropertyEditor registered for Integer, it is ok to use it for String -> Integer and Integer -> String; however it is not ok to use it to convert MyEntity -> String).
Attached test is based on:
If you want to show my use case, just let me know.
Referenced from: commits 6418b54
Juergen Hoeller commented
This is a bit of a tricky affair since custom String editors can produce a proper result in such a scenario: A custom String editor may produce a String presentation on a
So for a defensive change, I've added a fallback call to the