#211 Remove methods should not be considered fluent setters.#212
#211 Remove methods should not be considered fluent setters.#212jarlesat wants to merge 1 commit intomapstruct:mainfrom
Conversation
|
As you mentioned in #211, this depends on mapstruct/mapstruct#3072. To ensure consistency across all versions, the check should only be applied when a MapStruct version is detected in which the issue has been resolved. |
|
Thanks for the feedback. As soon as (and if) mapstruct/mapstruct#3072 is approved and merged, I will update the PR with a suggestion on how to do it. I guess that to extend MapStructVersion and MapstructUtil::resolveMapStructProjectVersion is the way to go. |
|
I have added some code to detect the mapstruct version by looking inside MANIFEST.MF of the jar containing the Mapper-annotation. Is this an acceptable method of detecting the verison? There does not seem to be any reliable method otherwise. If anyone can point me in any direction I will be more than happy to adjust this PR. This PR is also likely to not build as it depends on a version 1.7.0-SNAPSHOT of mapstruct that ignores removers. I have built and tested it locally against a version 1.7.0-SNAPSHOT of mapstruct that includes mapstruct/mapstruct#3072 and it seems to be fine. If the PR for mapstruct/mapstruct#3072 is merged I can update this PR accordingly. |
This is a first take on it.
With this change fluent remover's will be ignored when verifying the mapper. A remover (removePassenger) is added to FluentCarDTO as part of the tests.
Tested it with IntelliJ as well and seems to be working as intended, but I would be more than happy for feedback and suggestions.