-
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)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: taskA general taskA general task
Milestone
Description
Rob Winch opened SPR-14282 and commented
Given the following classes:
public class Foo {
@Autowired
Bar bar;
}
public class Bar { }
@Configuration
public class Config {
@Bean
public Foo foo() {
return new Foo();
}
@Bean
public Bar bar() {
return new Bar();
}
}It is not logical that the following test will fail since the autowire attribute on @Bean is by default NO:
try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
ctx.register(Config.class);
ctx.refresh();
Foo foo = ctx.getBean(Foo.class);
assertThat(foo.bar, nullValue());
}Affects: 3.2.17, 4.2.6, 4.3 RC2
Issue Links:
- Should @Configuration mark @Inject fields and setters as satisfied (injected)? [SPR-14180] #18751 Should
@Configurationmark@Injectfields and setters as satisfied (injected)?
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: taskA general taskA general task