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

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

Closed
spring-projects-issues opened this issue Jul 21, 2010 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 21, 2010

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good catch! In addition, this didn't work for generic superclasses at all - just for generic interfaces. I've fixed both issues for 3.0.4 now.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants