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
public class Test {
public static void main(String... args) {
System.out.println(new A("a"));
System.out.println(new B("b"));
}
}
@ToString
@RequiredArgsConstructor
public class A {
private final String x;
public String getX() {
System.out.println("getX() invoked on " + this.getClass());
return x;
}
}
@Data
public class B {
private final String x;
public String getX() {
System.out.println("getX() invoked on " + this.getClass());
return x;
}
}
A(x=a)
getX() invoked on class lombok.test.B
B(x=b)
So, property lombok.toString.doNotUseGetters isn't read by @Data. Maybe it's not a bug, but a wanted functionality. I probably won't agree with that, but I think at least som property like lombok.data.toString.doNotUseGetters is needed. Same happens for other properties of @ToString and @EqualsAndHashCode, but not for @Getter/@Setter.
The text was updated successfully, but these errors were encountered:
As a example, let's have these classes:
And a lombok.config file:
Execution prints:
So, property
lombok.toString.doNotUseGetters
isn't read by@Data
. Maybe it's not a bug, but a wanted functionality. I probably won't agree with that, but I think at least som property likelombok.data.toString.doNotUseGetters
is needed. Same happens for other properties of@ToString
and@EqualsAndHashCode
, but not for@Getter
/@Setter
.The text was updated successfully, but these errors were encountered: