mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-24 15:49:26 +00:00
fixed test failures with respect to null handling and PropertyTypeDescriptor usage for collection elements
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3448 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+1
-1
@@ -172,7 +172,7 @@ public class GenericConversionService implements ConversionService, ConverterReg
|
||||
}
|
||||
GenericConverter converter = getConverter(sourceType, targetType);
|
||||
if (converter == null) {
|
||||
if (targetType.getType().isInstance(source)) {
|
||||
if (source == null || targetType.getType().isInstance(source)) {
|
||||
logger.debug("No converter found - returning assignable source object as-is");
|
||||
return source;
|
||||
}
|
||||
|
||||
+9
@@ -117,4 +117,13 @@ public class PropertyTypeDescriptor extends TypeDescriptor {
|
||||
return anns;
|
||||
}
|
||||
|
||||
public TypeDescriptor forElementType(Class<?> elementType) {
|
||||
if (elementType == null) {
|
||||
return TypeDescriptor.UNKNOWN;
|
||||
}
|
||||
else {
|
||||
return new PropertyTypeDescriptor(this.propertyDescriptor, getMethodParameter(), elementType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user