Skip to content

Conversation

@rPraml
Copy link
Contributor

@rPraml rPraml commented Dec 13, 2024

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 ;)

@pivotal-cla
Copy link

@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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 13, 2024
@pivotal-cla
Copy link

@rPraml Thank you for signing the Contributor License Agreement!

}
else {
generics[i] = ResolvableType.forType(typeArgument);
generics[i] = ResolvableType.forType(typeArgument).resolveType();
Copy link
Contributor Author

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.

@rPraml rPraml changed the title Possible fix for 33968 Resolve method-only bounded generics correctly Dec 13, 2024
@snicoll snicoll changed the base branch from main to 6.2.x January 15, 2025 14:18
@snicoll snicoll changed the base branch from 6.2.x to main January 15, 2025 14:18
@snicoll snicoll self-assigned this Jan 15, 2025
@snicoll snicoll changed the title Resolve method-only bounded generics correctly Generic with a base type is no longer resolved to its base if the generic is unresolved Jan 15, 2025
@snicoll snicoll added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 15, 2025
@snicoll snicoll added this to the 6.2.2 milestone Jan 15, 2025
snicoll pushed a commit that referenced this pull request Jan 15, 2025
@snicoll snicoll closed this in e7f3493 Jan 15, 2025
@snicoll
Copy link
Member

snicoll commented Jan 15, 2025

Thanks very much @rPraml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: regression A bug that is also a regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants