Skip to content

Add support for resolving multiple bounds in type variables #22902

Closed
@d-roenko

Description

@d-roenko

Affects: 5.1.6 , and I believe any previous

Autowired list of beans with multiple bounds generics may result in ClassCastException in the runtime due to org.springframework.core.ResolvableType::resolveBounds taking only the first (return bounds[0]) bound into the account.

Here is the minimal reproducible example: https://github.com/d-roenko/multiple-bounds-generics/blob/03a9aad3040d69c3073510664dfb6a9bdc007cdb/src/main/java/com/example/demo/DemoApplication.java


Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions