INT-1974 removed the IF statement which was checking the state of the collection in favor of delegating to the ConversionService
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.springframework.integration.util;
|
||||
|
||||
import java.beans.PropertyEditor;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.SimpleTypeConverter;
|
||||
@@ -28,7 +27,6 @@ import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||
import org.springframework.expression.TypeConverter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -99,11 +97,6 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware
|
||||
if (targetType.getType() == Void.class || targetType.getType() == Void.TYPE) {
|
||||
return null;
|
||||
}
|
||||
if (value instanceof Collection<?>
|
||||
&& CollectionUtils.isEmpty((Collection<?>) value)
|
||||
&& Collection.class.isAssignableFrom(targetType.getObjectType())){
|
||||
return value;
|
||||
}
|
||||
if (conversionService.canConvert(sourceType, targetType)) {
|
||||
return conversionService.convert(value, sourceType, targetType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user