-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[BUG] Mapstruct mappers are wrong if lombok needs to create Builders in later rounds #3116
Comments
I think I'm running into that issue as well. I have a DTO class which uses
Interesting enough I only get the issue with Collections but everything else works fine. The DTO looks as follows:
Without the addOns collection mapstruct uses the builder, but ignores the collection.
As soon as I also want the collection mapped I get an error. |
@Drevsh Do you use an additional annotation processor to generate a new class with lombok annotations and try to map this one using mapstruct? If not your problem is something different. You can try if it is a lombok problem by replacing the lombok version with a delomboked version of your class. @fraenkelc Thanks for providing the example project. I tried to fix this by adding all processed classes to a |
Strange enough, I had a similar issue. In my case the addOn property was a simple String. Would it be possible that the problem is the property name? Like addOn being a special word? |
Gracias to @kanchev1 for fixing this one! Will be in next lombok release. |
Describe the bug
the lombok implementation of
AstModifyingAnnotationProcessor
inlombok/src/bindings/mapstruct/lombok/mapstruct/NotifierHider.java
Lines 19 to 33 in 560ded5
@SuperBuilder
or@Builder
).Instead of reporting to mapstruct if a given type is "complete" lombok reports "complete" for all files as long as it has run once.
To Reproduce
I've uploaded a reproducer project at /~https://github.com/fraenkelc/bug-lombok-mapstruct-ap
Steps:
@SuperBuilder
(probably also affects@Builder
) lombok annotation/~https://github.com/fraenkelc/bug-lombok-mapstruct-ap/blob/aa68ee421703115af6cd7c19d1045d3e110d506c/README.md?plain=1#L21-L43
Expected behavior
Lombok should correctly delay Mapstruct until it is done, e.g. by implementing AstModifyingAnnotationProcessor with a per-type logic instead of the current "ran once and done" logic.
Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: