Skip to content

Introspect factory method return type for type variable resolution at injection points [SPR-11521] #16146

Closed as not planned
@spring-projects-issues

Description

@spring-projects-issues

Juergen Hoeller opened SPR-11521 and commented

In Spring Framework 4.0, we take the factory method return type into account for injection targets (i.e. the right-hand side of an assignment) but not for injection points themselves (i.e. the left-hand side). As a consequence, type variables in @Autowired fields or method parameters are not getting resolved if the only place where they are being substituted is the return declaration of the factory method that creates the containing object. See the provided test scenario for #16096 for an example.

We should revisit this for 4.1, introspecting the factory method return type if the containing class itself doesn't substitute the type variable anywhere in its hierarchy.


Affects: 4.0.2

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions