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

Document the difference in generics resolution between @Autowired and beanFactory.getBeanProvider #27727

Closed
snicoll opened this issue Nov 24, 2021 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Nov 24, 2021

See the sample project for code example: https://github.com/snicoll-scratches/demo-unresolved-type-fallback

If a bean is defined with an unresolved generic such as NumberHolder<?> and the injection point is defined as NumberHolder<Integer>, @Autowired is able to inject the bean whereas a getIfAvailable call on getBeanProvider returns null.

It looks like an inconsistency in the dependency resolution algorithm.

@snicoll snicoll added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 24, 2021
@jhoeller jhoeller changed the title Inconsistent dependency resolution between @Autowired and beanFactory.getOBjectProvider Inconsistent dependency resolution between @Autowired and beanFactory.getBeanProvider Nov 24, 2021
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 24, 2021
@jhoeller jhoeller self-assigned this Nov 24, 2021
@jhoeller jhoeller added this to the 5.3.14 milestone Nov 24, 2021
@jhoeller jhoeller changed the title Inconsistent dependency resolution between @Autowired and beanFactory.getBeanProvider Inconsistent generics resolution between @Autowired and beanFactory.getBeanProvider Nov 26, 2021
@snicoll snicoll changed the title Inconsistent generics resolution between @Autowired and beanFactory.getBeanProvider Document the difference in generics resolution between @Autowired and beanFactory.getBeanProvider Dec 8, 2021
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) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants