git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3260 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2010-04-17 06:47:08 +00:00
parent 2e128337be
commit ef2409017c
2 changed files with 6 additions and 9 deletions
@@ -433,12 +433,10 @@ public class TypeDescriptor {
if (this == TypeDescriptor.NULL || targetType == TypeDescriptor.NULL) {
return true;
}
if (isCollection()) {
return targetType.isCollection() && getElementTypeDescriptor().isAssignableTo(targetType.getElementTypeDescriptor());
} else if (isMap()) {
return targetType.isMap() && getMapKeyTypeDescriptor().isAssignableTo(targetType.getMapKeyTypeDescriptor()) && getMapValueTypeDescriptor().isAssignableTo(targetType.getMapValueTypeDescriptor());
} else if (isArray()) {
return targetType.isArray() && getElementTypeDescriptor().isAssignableTo(targetType.getElementTypeDescriptor());
if (isCollection() && targetType.isCollection() || isArray() && targetType.isArray()) {
return targetType.getType().isAssignableFrom(getType()) && getElementTypeDescriptor().isAssignableTo(targetType.getElementTypeDescriptor());
} else if (isMap() && targetType.isMap()) {
return targetType.getType().isAssignableFrom(getType()) && getMapKeyTypeDescriptor().isAssignableTo(targetType.getMapKeyTypeDescriptor()) && getMapValueTypeDescriptor().isAssignableTo(targetType.getMapValueTypeDescriptor());
} else {
return targetType.getObjectType().isAssignableFrom(getObjectType());
}