-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed as not planned
Closed as not planned
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Affects: Spring 5.3.18
When registering a new bean X2 of type X and marking it as the primary implementation, a previously @Autowired
field is still returning the previous instance type X1 when the parent bean instance is constructed.
Expected: The new primary class X2 is injected. The class with the @Autowired field is marked with @scope("prototype").
Actual: The previous class X1 is injected instead.
This code screenshot should be able to explain the issue better:
PS. If the parent bean has not been retrieved prior to the bean definition, it works fine. The correct bean X2 is being returned.
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid