Skip to content

Generic autowiring should support wiring of components with unresolved type variables [SPR-10993] #15621

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

Closed
spring-projects-issues opened this issue Oct 16, 2013 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 16, 2013

Oliver Drotbohm opened SPR-10993 and commented

If an ApplicationContext contains BeanDefinition instances for a type MyComponent<T> and you try to wire it to an injection point that explictly refers to a type parameter (e.g. MyComponent<String>) you currently get a NoSuchBeanDefinitionException.


Affects: 4.0 RC1

Issue Links:

Referenced from: commits 0851766

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 18, 2013

nebhale commented

Sorry for the crossed wires, but there's now a duplicate issue at #15632. It has a simple test-case attached, if you need it, otherwise go ahead and kill it.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

DefaultListableBeanFactory performs a fallback check for autowire candidates now, which GenericTypeAwareAutowireCandidateResolver implements to accept raw type matches if the target class has unresolvable type variables. Full generic matches are still preferred; the BeanFactory will only start looking for fallback matches if the first pass led to an empty result.

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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants