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

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

spring-issuemaster opened this issue Oct 16, 2013 · 2 comments


Copy link

@spring-issuemaster spring-issuemaster 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:

  • #15632 Autowiring of types narrows with generics does not work
  • #14599 Autowiring of generic types

Referenced from: commits 0851766


This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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.


This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Oct 25, 2013

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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.