Skip to content

Document method visibility rules for @Bean methods [SPR-12345] #16950

@spring-projects-issues

Description

@spring-projects-issues

Bob Tiernay opened SPR-12345 and commented

There used to be documentation in the JavaConfig project that discussed the effect of method visibility on bean scope:

http://docs.spring.io/spring-javaconfig/docs/1.0-m2/reference/html/bean-visibility.html

This documentation does not appear to exist in:

http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/beans.html#beans-factorybeans-annotations

However, there is an example in that section regarding a privateInstance but the semantics are still undefined. I am still unclear what effect marking an @Bean method private has. I was hoping it would make it private to the @Configuration as that could be very useful in certain circumstances.

Nevertheless, it would be extremely useful to document these semantics.


Affects: 4.1.1

Referenced from: commits f58e1db

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions