-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Generic with a base type is no longer resolved to its base if the generic is unresolved #34086
Conversation
@rPraml Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@rPraml Thank you for signing the Contributor License Agreement! |
@@ -180,7 +180,7 @@ else if (genericType instanceof ParameterizedType parameterizedType) { | |||
generics[i] = resolvedTypeArgument; | |||
} | |||
else { | |||
generics[i] = ResolvableType.forType(typeArgument); | |||
generics[i] = ResolvableType.forType(typeArgument).resolveType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I understand the code here, we want to resolve the T
of a generic. If the T
is not defined by the contextType, (because ist is no class Foo<T extends Bar>
) we get to this line.
In my case, the T is bound by the function public <T extends BaseType> List<T> get()
and means, that T
is at least a BaseType
IMHO the type must be resolved here, so that the following code knows , that the elements in the list are BaseType
or subtypes. This is later required for jackson, otherwise we have problems mentioned in this SO post.
Thanks very much @rPraml |
I tried to make a unit test and a possible fix for #33968
Someone who knows more about it than me should take another look at the fix ;)