Skip to content

fix: methods contained in @Context classes don't support generics#3867

Merged
filiphr merged 2 commits intomapstruct:mainfrom
tangyang9464:fix/3711
May 31, 2025
Merged

fix: methods contained in @Context classes don't support generics#3867
filiphr merged 2 commits intomapstruct:mainfrom
tangyang9464:fix/3711

Conversation

@tangyang9464
Copy link
Contributor

fix: #3711

The bug is caused by not handling generics properly when generating context methods

Copy link
Member

@filiphr filiphr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @tangyang9464. I've left a comment, I am not too fond of the fix. I would rather do it slightly differently.

@tangyang9464 tangyang9464 force-pushed the fix/3711 branch 2 times, most recently from 51e397d to f90fa37 Compare May 26, 2025 03:12
Signed-off-by: TangYang <tangyang9464@163.com>
@tangyang9464
Copy link
Contributor Author

Why don't we change the first method of the retrieveMethods and instead of passing TypeElement for the usedMapper we can pass our Type.

@filiphr done. plz review again.

@filiphr filiphr merged commit 5464c3c into mapstruct:main May 31, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support generic @Context

2 participants