-
Notifications
You must be signed in to change notification settings - Fork 39
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
False positives for Lombok's @Data annotation #557
Comments
Hi @ksiczek, thanks for taking the time to report an issue! This sure looks like a bug and should be fixed. The thing is that Lombok probably generates extra parentheses "under the hood" that are flagged by this check.
This is interesting and didn't expect that though 🤔. I think we should have something to exclude certain annotations from this analysis. We have this code in a different check that is probably similar to what we need here. I'll need some more time to dive a bit deeper into this before I can give a good answer or direction. Already wanted to share this and let you know we noticed the issue 😄. |
What version of Lombok are you using? I tried to reproduce it in the project by using the following test (using Lombok 1.18.26):
It didn't fail for me, so it might be the case that this test doesn't fully use the features of Lombok? CC: @Stephan202. |
We also use the |
I can't reproduce the issue using tests aswell. I also tried using example project from #716 wtih |
Thanks for looking into this @mohamedsamehsalah. Good to know 😄. @ksiczek Can you try running it without |
That's correct; for Lombok to work in this case, it needs to be enabled explicitly. See the I had hoped that the solution implemented in google/error-prone#4076 would also resolve this issue, but it doesn't, because the issue at hand is that That then leaves the question: why does the check attempt to flag the (already canonical) Possible next steps (not mutually exclusive):
Point (2) could involve something like was attempted in #728, but as I also mentioned there: I really prefer that also here we identify a more generic solution. (A |
Describe the bug
of the project.
already known.
Minimal Reproducible Example
Given below class
we get unclear recommendations saying that we might replace
@Data
with@Data
(see Logs section). It seems it happens only for Lombok@Data
, or@Setter
:Logs
I tried several different combinations of the annotations and configurations and it seems that:
JsonProperty
's parameterExpected behavior
I'm pretty sure that the error message does not help much so it is either a bug in the analysis or in the message. Does it sound familiar to you guys?
Setup
2.18.0
0.8.0
disableWarningsInGeneratedCode = true
in the configurationAdditional context
I just started using☺️
error-prone
and it might be a good opportunity for me to see how custom rules work. If you consider reported behavior a bug I think I could dive deeper into itThe text was updated successfully, but these errors were encountered: