Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading description in Autowired javadoc [SPR-17299] #21832

Closed
spring-projects-issues opened this issue Sep 23, 2018 · 1 comment
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

rupertw opened SPR-17299 and commented

Comments on applying the annotation Autowired to constructor are error,

* <p>Only one constructor (at max) of any given bean class may carry this annotation,
* indicating the constructor to autowire when used as a Spring bean. Such a
* constructor does not have to be public.

we can refer to the javadoc of class AutowiredAnnotationBeanPostProcessor for correct description.

* <p>Only one constructor (at max) of any given bean class may carry this
* annotation with the 'required' parameter set to {@code true},
* indicating <i>the</i> constructor to autowire when used as a Spring bean.
* If multiple <i>non-required</i> constructors carry the annotation, they
* will be considered as candidates for autowiring. The constructor with
* the greatest number of dependencies that can be satisfied by matching
* beans in the Spring container will be chosen. If none of the candidates
* can be satisfied, then a default constructor (if present) will be used.
* An annotated constructor does not have to be public.

Affects: 5.1 GA

Referenced from: pull request #1966

Backported to: 5.0.10, 4.3.20

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good catch! Addressed as part of a wider javadoc revision now.

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: documentation A documentation task in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.1.1 milestone Jan 11, 2019
This was referenced Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants