Generic with a base type is no longer resolved to its base if the generic is unresolved#34086
Generic with a base type is no longer resolved to its base if the generic is unresolved#34086rPraml wants to merge 2 commits into
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! |
| } | ||
| else { | ||
| generics[i] = ResolvableType.forType(typeArgument); | ||
| generics[i] = ResolvableType.forType(typeArgument).resolveType(); |
There was a problem hiding this comment.
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 ;)