Skip to content

Update documentation after SPR-3542 [SPR-12570] #17171

Closed
@spring-projects-issues

Description

@spring-projects-issues

Qadeer Ahmad opened SPR-12570 and commented

In #8225, changes were made in bean inheritance regarding scope. However, the documentation about this particular bit remains unchanged:

http://docs.spring.io/spring/docs/4.1.x/spring-framework-reference/html/beans.html#beans-child-bean-definitions

...
The remaining settings are always taken from the child definition: depends on, autowire mode, dependency check, singleton, scope, lazy init.

The same text is found in the version prior to this change: http://docs.spring.io/spring/docs/2.5.x/reference/beans.html#beans-child-bean-definitions

With the changes in #8225, the scope property is inherited from the parent bean definition if not defined in the child. The scope property is not always taken from the child property. In my opinion this part of the documentation should be updated to explicitly describe when the scope property is inherited.

Background: I was working with a some legacy system where I updated Spring from version 2.5.x to 3.2.x. After the upgrade, many tests started to fail due to this change. After some debugging I found that the scope was not the same anymore, but I could not understand why because the documentation was the same about this part. Fortunately, I found the Jira issue and the changelog, and understood that the bean definition inheritance had actually changed.

I think the update in documentation can help others in the similar situation.


Issue Links:

Backported to: 4.0.9, 3.2.13

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions