mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
introspect element type in case of incoming Collection/Map in order to not accidentally say canConvert=true (SPR-6564)
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user