-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] boolean @Getter conflicts with explicit getter #3519
Comments
I agree that we could optimize the error message a little bit but at least it already prints the name of the conflicting method. To fix your problem you can add |
It's intended behaviour. Leaving the issue open solely for improving the error message we produce here. |
Multiline errors? I'd have to check what that looks like in eclipse and intellij. item 2 also feels superfluous. I'm not sure if that was your intention, @nell-shark but I think it's fine to special case it here. There are 2 options:
|
Describe the bug
I found some code that had a private boolean field:
It had an explicit getter method:
I wanted to replace this getter with a Lombok
@Getter
, which would result in aisProperty()
method, but leaving thegetProperty()
as a@Deprecated
method.During compiling the following message is logged:
Funny thing is that if I would rename the getter to something else it would work, for example
whateverProperty()
. There seems to be some conflict between the "get" and "is" prefix for getters for boolean fields.Expected behavior
The error message is not correct: there is not a method with that name. The functionality should be changed so this is just allowed, or the error message should be more clear. My preference: I would like to be able to keep (as
@Deprecated
) an explicit getter method on a boolean field and have the@Getter
generated.Version info (please complete the following information):
11.0.17 2022-10-18
OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)
OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)
The text was updated successfully, but these errors were encountered: