You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, String is final, therefore the ? extends is not needed.
The Java compiler generates a warning:
name clash: names(java.util.Collection<? extends java.lang.String>) in nl.DefaultItem.Builder and names(java.util.Collection<java.lang.String>) in nl.ItemBuilder have the same erasure, yet neither overrides the other
Expected fix
Add a case for final classes, to not generate the wildcard.
Expected behavior
Generate B names(Collection<String> names)
Version info (please complete the following information):
Latest Lombok
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
@rspilker Okay, in what cases is resolution not reliable? And do you have any examples of resolution?
I tried to come up with a PR, but I was not able to properly set up the codebase, so I had no code completion etc.
I would like to continue on this soon and I could use more information about resolution. Maybe it is possible. Maybe not -- but I'd like to figure that out. :)
If you have "package c; import a.b.*;" in your file, and class "c.Baz" exists, then a class reference to class "Baz" in this file is a reference to "c.Baz", but if you ask lombok's own resolver if this "Baz" reference is a reference to "a.b.Baz", lombok answers 'yes', eventhough it should have answered 'no'.
In this case it means that you could detect a class as final, but in fact the resolver was wrong and it is another class that is not final. In this case, you would generate wrong code.
Describe the bug
When using
A builder method
is generated.
However,
String
isfinal
, therefore the? extends
is not needed.The Java compiler generates a warning:
Expected fix
Add a case for final classes, to not generate the wildcard.
Expected behavior
Generate
B names(Collection<String> names)
Version info (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: