Skip to content
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

Regression in 1.18.10: @Wither broken (workarounds available) #2235

Closed
rspilker opened this issue Sep 12, 2019 · 0 comments
Closed

Regression in 1.18.10: @Wither broken (workarounds available) #2235

rspilker opened this issue Sep 12, 2019 · 0 comments

Comments

@rspilker
Copy link
Collaborator

TL;DR: @Wither no longer generates withXxx methods if it is imported with a star import like import lombok.experimental.*

Since Lombok version 1.18.10, @Wither has been promoted. @lombok.experimental.Wither still exists but is marked @Deprecated. It is replaced by @lombok.With.

Although we have tests to see if the old annotation still works, we didn't have a test that used a star import.

Workaround 1

Use @lombok.With or @With in combination with an import instead of @Wither in combination with import lombok.experimental.*;. This will also take care of deprecation warnings.

Workaround 2

Use @lombok.experimental.Wither instead of @Wither in combination with import lombok.experimental.*;. This is longer, but will work in all cases.

Workaround 3

Replace import lombok.experimental.* with import lombok.experimental.Wither.
Potentially you also need to add imports for other experimental features.
You might need to change the import rules in your IDE to not collapse multiple imports to a star import.

@rspilker rspilker pinned this issue Sep 12, 2019
@rspilker rspilker changed the title Regression in 1.18.10: @Wither no longer generates code (workarounds available) Regression in 1.18.10: @Wither broken (workarounds available) Sep 12, 2019
@rzwitserloot rzwitserloot removed the soon label Feb 6, 2020
@rzwitserloot rzwitserloot unpinned this issue Feb 7, 2020
Febell pushed a commit to Febell/lombok that referenced this issue Mar 1, 2020
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

No branches or pull requests

2 participants