|
|
|
@ -79,8 +79,8 @@ abstract class IndexedElementsBinder<T> extends AggregateBinder<T> {
|
|
|
|
|
ConfigurationProperty property = source.getConfigurationProperty(root);
|
|
|
|
|
if (property != null) {
|
|
|
|
|
Object aggregate = convert(property.getValue(), aggregateType);
|
|
|
|
|
ResolvableType collectionType = ResolvableType
|
|
|
|
|
.forClassWithGenerics(collection.get().getClass(), elementType);
|
|
|
|
|
ResolvableType collectionType = forClassWithGenerics(
|
|
|
|
|
collection.get().getClass(), elementType);
|
|
|
|
|
Collection<Object> elements = convert(aggregate, collectionType);
|
|
|
|
|
collection.get().addAll(elements);
|
|
|
|
|
}
|
|
|
|
@ -140,6 +140,17 @@ abstract class IndexedElementsBinder<T> extends AggregateBinder<T> {
|
|
|
|
|
return ResolvableTypeDescriptor.forType(type).convert(conversionService, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Work around for SPR-16456
|
|
|
|
|
protected static ResolvableType forClassWithGenerics(Class<?> type,
|
|
|
|
|
ResolvableType... generics) {
|
|
|
|
|
ResolvableType[] resolvedGenerics = new ResolvableType[generics.length];
|
|
|
|
|
for (int i = 0; i < generics.length; i++) {
|
|
|
|
|
resolvedGenerics[i] = forClassWithGenerics(generics[i].resolve(),
|
|
|
|
|
generics[i].getGenerics());
|
|
|
|
|
}
|
|
|
|
|
return ResolvableType.forClassWithGenerics(type, resolvedGenerics);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@link AggregateBinder.AggregateSupplier AggregateSupplier} for an indexed
|
|
|
|
|
* collection.
|
|
|
|
|