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

@Primary not working for FactoryBeans #22675

Closed
pnescior opened this issue Mar 26, 2019 · 1 comment
Closed

@Primary not working for FactoryBeans #22675

pnescior opened this issue Mar 26, 2019 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: superseded An issue that has been superseded by another

Comments

@pnescior
Copy link

Affects: Spring 5.1.5.RELEASE


Defining multiple FactoryBeans, and then marking one of them with @Primary doesn't work as expected.
There is related stack overflow issue for that, but shouldn't it be considered as a bug?

One could say that treating FactoryBean as a bean itself is some kind of overkill, but in my opinion, there are justified use cases.
For example, take look at artembilan argumentation in this similar issue, but related to spring-integration.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 26, 2019
@jhoeller jhoeller self-assigned this Mar 26, 2019
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Mar 26, 2019
lgxbslgx added a commit to lgxbslgx/spring-framework that referenced this issue Mar 30, 2019
Transform the beanName in method DefaultListableBeanFactory.isPrimary.
Add the corresponding test cases.
Fixes spring-projects#22675.
@jhoeller jhoeller added status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 2, 2019
@jhoeller
Copy link
Contributor

jhoeller commented Apr 2, 2019

Superseded by PR #22711.

@jhoeller jhoeller closed this as completed Apr 2, 2019
jhoeller pushed a commit that referenced this issue Apr 2, 2019
Transform the beanName in method DefaultListableBeanFactory.isPrimary.
Add the corresponding test cases.
Fixes #22675.
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: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

4 participants