-
Notifications
You must be signed in to change notification settings - Fork 38k
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.resolveType() should resolve ParameterizedType recursively #24963
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: superseded
An issue that has been superseded by another
type: enhancement
A general enhancement
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
Apr 23, 2020
Type type = m.getGenericReturnType(); // List<List<T>>
ResolvableType.forType(type).hasUnresolvableGenerics(); //should be true but false |
Here is my workaround public static Type resolve(Type type, Class<?> contextClass) {
if (type instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) type;
ResolvableType[] generics = new ResolvableType[pt.getActualTypeArguments().length];
int i = 0;
for (Type arg : pt.getActualTypeArguments()) {
generics[i++] = ResolvableType.forType(resolve(arg, contextClass));
}
return ResolvableType.forClassWithGenerics((Class<?>) pt.getRawType(), generics).getType();
}
return GenericTypeResolver.resolveType(type, contextClass);
} |
rstoyanchev
added
the
in: core
Issues in core modules (aop, beans, core, context, expression)
label
Nov 11, 2021
This comment was marked as duplicate.
This comment was marked as duplicate.
Superseded by #30079 |
sbrannen
added
type: enhancement
A general enhancement
status: superseded
An issue that has been superseded by another
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Mar 8, 2023
quaff
added a commit
to quaff/spring-framework
that referenced
this issue
Nov 30, 2023
jhoeller
pushed a commit
that referenced
this issue
Feb 15, 2024
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)
status: superseded
An issue that has been superseded by another
type: enhancement
A general enhancement
will print
The expected type for m3 should be
java.util.List<java.util.List<String>>
The text was updated successfully, but these errors were encountered: