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

Detect @Autowired constructors for configuration classes [SPR-13471] #18050

Closed
spring-projects-issues opened this issue Sep 18, 2015 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 18, 2015

Stéphane Nicoll opened SPR-13471 and commented

@Configuration classes must currently have a public no-arg constructor (see javadoc) so we're relying on field/setter injection for (shared) collaborators. It would be nice if we would support constructor injection as well.


Issue Links:

Referenced from: commits 1fc3fc8, 967ef73

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 18, 2015

Stéphane Nicoll commented

Juergen, as we discussed I am assigning that one back to you. Current master will allow a @Configuration class to use constructor injection as long as there is one constructor for the class. However, adding @Autowired in case of several constructors to teach the container the one to use won't work most probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants