Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Oct 18, 2013

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. spring-projects-issues commented on Oct 25, 2013

    @spring-projects-issues
    CollaboratorAuthor

    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.

  3. added
    type: bug
    in: core
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions