GH-2705: AOT support complex binding properties
- Sets the conversion service on AOT child binder contexts to allow complex properties to be bound in extended binding props Fixes #2705
This commit is contained in:
@@ -543,9 +543,11 @@ public class DefaultBinderFactory implements BinderFactory, DisposableBean, Appl
|
||||
*/
|
||||
GenericApplicationContext createUnitializedContextForAOT(String configurationName,
|
||||
Map<String, Object> binderProperties, BinderConfiguration binderConfiguration) {
|
||||
|
||||
GenericApplicationContext binderContext = new GenericApplicationContext();
|
||||
|
||||
// Set the conversion service on the binder producing context to handle complex properties
|
||||
if (this.context != null) {
|
||||
binderContext.getBeanFactory().setConversionService(this.context.getBeanFactory().getConversionService());
|
||||
}
|
||||
MapPropertySource binderPropertySource = new MapPropertySource(configurationName, binderProperties);
|
||||
binderContext.getEnvironment().getPropertySources().addFirst(binderPropertySource);
|
||||
binderContext.setDisplayName(configurationName + "_context");
|
||||
|
||||
Reference in New Issue
Block a user