Content-Length: 311225 | pFad | http://github.com/mapstruct/mapstruct/pull/3868

24 feat: Support @AnnotatedWith on class specified by @DecoratedWith by tangyang9464 · Pull Request #3868 · mapstruct/mapstruct · GitHub
Skip to content

feat: Support @AnnotatedWith on class specified by @DecoratedWith #3868

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

Merged
merged 4 commits into from
May 31, 2025

Conversation

tangyang9464
Copy link
Contributor

close: #3659

Signed-off-by: TangYang <tangyang9464@163.com>
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.

How does this work with the Spring decoration? In the @Mapper we are doing some special stuff in case someone uses @AnnotateWith with @Component.

@tangyang9464 tangyang9464 marked this pull request as draft May 26, 2025 10:15
1. Added deduplication of annotations for spring decorator when using @DecoratedWith.
2. Added @DecoratedWith tests for various ComponentModel decorators

Signed-off-by: TangYang <tangyang9464@163.com>
@tangyang9464 tangyang9464 marked this pull request as ready for review May 26, 2025 16:42
@tangyang9464
Copy link
Contributor Author

How does this work with the Spring decoration? In the @Mapper we are doing some special stuff in case someone uses @AnnotateWith with @Component.

For spring, I removed duplicates of @Component and @Primary (just like @component in mapper).

For jsr330/jarkata, since they do not support combined annotations like spring, combined annotations added by users (such as contain @Named) don't work; repeated additions of @Named and @Singleton will also cause compilation errors, so I think they don't need to be processed, just add corresponding tests to ensure that the annotations added by @AnnotateWith can take effect.

Do you think there are other scenarios that need to be handled? @filiphr

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 @tangyang9464. I pushed some polishing commits, I'll merge once the build passes

@filiphr filiphr merged commit ce84c81 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 @AnnotatedWith on decorators
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mapstruct/mapstruct/pull/3868

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy