Skip to content

GenericTypeResolver returns Object for parameterized parameters [SPR-7389] #12047

@spring-projects-issues

Description

@spring-projects-issues

Oliver Drotbohm opened SPR-7389 and commented

Suppose you have a generic type MyType<T> and a concrete type based on that types T to a parameterized type again MyConcreteType extends MyType<Collection<String>>. Using GenericTypeResolver.resolveTypeArguments(MyConcreteType.class, MyType.class) returns Object as resolved type where Collection would be expected.

I dived into the sources and it seems extractClass(Class ownerClass, Type arg) misses a check for Type being an instance of ParameterizedType. In this case it could simply return ((ParameterizedType) type).getRawType(). Currently it simply returns Object.


Affects: 3.0.3

Issue Links:

Referenced from: commits b7b7c06

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions