-
-
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
[fixes #3116] Add multi round support for mapstruct #3744
[fixes #3116] Add multi round support for mapstruct #3744
Conversation
6100989
to
61ea0de
Compare
61ea0de
to
04c9755
Compare
Thanks, @kanchev1 ! I just restored the 'hey if lombok is entirely disabled, just tell mapstruct we are definitely not going to modify that AST anymore' and applied the house style. Good work. |
Hi all, I think this commit introduced a regression in Lombok. I have the following steps to reproduce :
Update: Filed #3777 for more visibility. |
@rgrunber Could you open an issue for this in lombok repository? |
This issue will now be reverted, and, we think, this approach of fixing it is a dead end. As far as we can tell:
The impl simply asks the This isn't complete! Lombok can trigger on annotations on local variables (such as That's why its a dead end. Yes, the Separately, lombok might want to leave some lombok artefacts behind. We already do that: Hence, the strategy chosen seems fundamentally unworkable. We think the following strategy would work: Instead of 'globally' tracking "has lombok run yet?", track it per source file (in AST terms, per compilation unit). If lombok has completed an entire cycle on some source file, then that type is complete. It's not about whether lombok stuff remains in it (it might, stuff like I guess storing some sort of hashset containing every type being compiled in one go is possibly a slight memory hog, but it's probably fine. In the end shoving 20k strings each ~40 chars long into a hashset isn't all that much memory these days. |
Report to MapStruct that a type is completed when there aren't any Lombok annotations left on it. Lombok annotations are removed whenever a class is processed. This way, annotations which require multiple rounds to process are also correctly handled, and MapStruct processing will be delayed until Lombok completely finishes processing required types.
Fixes issues with e.g. @FieldNameConstants and @builder (see #3116)