-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
When using BeanDefinitionBuilder.addAutowiredProperty AOT code generation fails with:
Code generation does not support org.springframework.beans.factory.config.AutowiredPropertyMarker.
@Test
void autowiredProperty() {
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
beanFactory.registerBeanDefinition("auditor", BeanDefinitionBuilder.rootBeanDefinition(Auditor.class).getBeanDefinition());
beanFactory.registerBeanDefinition("holder", BeanDefinitionBuilder.rootBeanDefinition(AuditorHolder.class).addAutowiredProperty("auditor").getBeanDefinition());
GenericApplicationContext ctx = new GenericApplicationContext(beanFactory);
TestGenerationContext testGenerationContext = new TestGenerationContext();
ApplicationContextAotGenerator generator = new ApplicationContextAotGenerator();
generator.processAheadOfTime(ctx, testGenerationContext);
testGenerationContext.writeGeneratedContent();
}
static class Auditor {
}
static class AuditorHolder {
Auditor auditor;
public void setAuditor(@Nullable Auditor auditor) {
this.auditor = auditor;
}
}Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug