-
-
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
Overloading a Builder's method for mass-adding to a Singular field removed the default convenience methods #1841
Comments
I would have expected and error saying As far as I can see from the code, it only looks at the method names. One of the reasons is that it is very hard for us to see if you've created an overload or a replacement method. The latter will not really work since we have an (on purpose) undocumented internal representation that is optimized for further processing. |
@rspilker I see the error you mentioned. However, overloads should be supported with |
@Tolerate is still experimental for now, But that would be a good way to mitigate this issue. |
I have encountered this exact issue. Currently I work around it by using a different name for the method I write that takes a different the of arguments from the method that lombok generates, but being able to overload the lombok method would create a cleaner interface. IMHO, I concur with the suggestion that explicitly annotating the manually created method with @Tolerate would be a good compromise. |
I remark that this issue is a duplicate of the older (albeit less well documented and commented on) #1498 |
For a
@Singular List<E> elements
the@Builder
generates 3 convenience methods:element(E element)
elements(Collection<? extends E> elements)
clearElements()
but if I try to overload the collection setter it no longer generates these 3 methods.
The text was updated successfully, but these errors were encountered: