Merge branch '2.4.x'
This commit is contained in:
commit
01746453f7
|
@ -32,7 +32,6 @@ import org.springframework.boot.context.properties.source.IterableConfigurationP
|
|||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Base class for {@link AggregateBinder AggregateBinders} that read a sequential run of
|
||||
|
@ -90,7 +89,7 @@ abstract class IndexedElementsBinder<T> extends AggregateBinder<T> {
|
|||
|
||||
private void bindValue(Bindable<?> target, Collection<Object> collection, ResolvableType aggregateType,
|
||||
ResolvableType elementType, Object value) {
|
||||
if (value instanceof String && !StringUtils.hasText((String) value)) {
|
||||
if (value == null || value instanceof CharSequence && ((CharSequence) value).length() == 0) {
|
||||
return;
|
||||
}
|
||||
Object aggregate = convert(value, aggregateType, target.getAnnotations());
|
||||
|
|
|
@ -40,7 +40,6 @@ class CharSequenceToObjectConverterTests {
|
|||
@ConversionServiceTest
|
||||
void convertWhenCanConvertDirectlySkipsStringConversion(ConversionService conversionService) {
|
||||
assertThat(conversionService.convert(new String("1"), Long.class)).isEqualTo(1);
|
||||
System.out.println(conversionService.getClass());
|
||||
if (!ConversionServiceArguments.isApplicationConversionService(conversionService)) {
|
||||
assertThat(conversionService.convert(new StringBuilder("1"), Long.class)).isEqualTo(2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue