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

[BUG] EqualsAndHashCode duplicates Nullable annotations with NonNullByDefault and lombok.addNullAnnotations #3120

Closed
jopatai opened this issue Feb 23, 2022 · 0 comments
Milestone

Comments

@jopatai
Copy link
Contributor

jopatai commented Feb 23, 2022

Describe the bug
When a flavor of NonNullByDefault annotation is present, the equals method is (correctly) generated with an overriding Nullable annotation.
When configuration lombok.addNullAnnotations is present, the equals method is (correctly) generated with a Nullable annotation.
When both are present, the same annotation is generated twice, which does not compile.

To Reproduce

//CONF: lombok.addNullAnnotations = javax
@lombok.EqualsAndHashCode
@javax.annotation.ParametersAreNonnullByDefault
class someClass

Expected behavior
Only one annotation is generated.

Version info

  • Lombok version 1.18.22
  • Platform Eclipse 2021-12 (4.22.0)
jopatai added a commit to jopatai/lombok that referenced this issue Feb 25, 2022
Update AUTHORS file. Remove extraneous code from
EqualsAndHashCodeWithNonNullByDefault test case.
@rzwitserloot rzwitserloot added this to the next-version milestone Mar 17, 2022
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