Why @Getter of Lombok propagates field annotation @NotNull?

Viewed 178

My question is simple and the answer could be simpler but I haven't found anything so far.

Original code

Lombok 1.18.24 (last so far) propagates annotation "@NotNull" to its generated getter method, as I checked out using a decompiler over the .class file:

Generated code

It is funny because other annotations such as @javax.validation.constraints.NotEmpty, it does not propagate. It is my solution so far.

I tried to use lombok.config as follows (but no success):

lombok.copyableAnnotations -= javax.validation.constraints.NotNull

and as follows (no success either):

clear lombok.addNullAnnotations

In short, I would like Lombok does not propagate it. How to avoid @Getter propagates field annotation @javax.validation.constraints.NotNull to respective getter?

0 Answers
Related