introspect element type in case of incoming Collection/Map in order to not accidentally say canConvert=true (SPR-6564)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2671 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-12-15 12:36:22 +00:00
parent 95d1eccd65
commit 246bb34e08
8 changed files with 209 additions and 17 deletions
@@ -194,7 +194,7 @@ class TypeConverterDelegate {
// No custom editor but custom ConversionService specified?
ConversionService conversionService = this.propertyEditorRegistry.getConversionService();
if (editor == null && conversionService != null && convertedValue != null) {
TypeDescriptor sourceTypeDesc = TypeDescriptor.valueOf(convertedValue.getClass());
TypeDescriptor sourceTypeDesc = new TypeDescriptor(convertedValue);
if (conversionService.canConvert(sourceTypeDesc, typeDescriptor)) {
return (T) conversionService.convert(convertedValue, sourceTypeDesc, typeDescriptor);
}