Closed
Description
Tested on 1.18.2 and 1.16.18
@ToString
enum SampleEnum {
SOME_FIELD;
}
Currently above enum is compiled into below code.
enum SampleEnum {
SOME_FIELD;
public String toString() {
return "SampleEnum ()";
}
}
So whenever i run toString on List I will get N "SampleEnum()" strings.
It should be compiled to:
enum SampleEnum {
SOME_FIELD;
public String toString() {
return "SampleEnum (name())";
}
}
or anything that indicates enums field name.
Activity
rspilker commentedon Nov 5, 2018
I suggest to use
return "SampleEnum." + name() + "()";
rzwitserloot commentedon Jan 29, 2019
this is now available in edge release: https://projectlombok.org/download-edge