Open nlisker opened 2 years ago
I guess that only the outline is wrong. The support for adding the generated delegate methods in the outline is quite new so most likely it simply doesn't work properly.
Alright, if it's just the IDE then it's not too bad. What about excluding the Comparable
method?
It does not seem to be only an IDE issue, the following compiles and prints hello
, so the compareTo()
delegate is definitely generated despite the excludes:
enum ASD {
TEST;
public static void main(String[] args) {
if (new FADSF().compareTo(ASD.TEST) == 0) {
System.out.println("hello");
}
}
}
class FADSF {
@Delegate(excludes = {Enum.class, Comparable.class})
ASD asd = ASD.TEST;
}
In Eclipse, the annotation generates the enum methods 3 times:
If you exclude the
Enum
methods, you are left with theComparable
one, but also 3 times:Also, excluding
java.lang.Comparable.class
does not remove thecompareTo
method. I think that that it is because it's a generic interface and@Delegate
has known limitations with generics. Then again,Enum
is also a generic type and its methods are removed.Adding a custom method to the enum also causes that one to be generated 3 times, so it's not just those declared in
Enum
.Using Eclipse 4.21 and Lombok 1.18.22.
I'm trying to find a way to delegate only my custom methods from an enum (and only once), Excluding
Enum
helps, but thecompareTo
method is still there and all methods appear 3 times.