Lombok version in 2.6.7 breaks code #30777
Labels
for: external-project
For an external project and not something we can fix
status: invalid
An issue that we don't feel is valid
With Spring Boot 2.6.7 you also updated the version of lombok. This version of Lombok propagates (some of) the field annotations to the generated getters and setters. This is not always valid/desired and actually leads to valid code breaking (at runtime).
Simple case:
Here for example, the setter (and getter) of ID get annotated with
@NotNull
. However this is a perfectly valid (actually mandatory) value when the AccountDto object is validated with CreateValidation. Moreover, at runtime you get anjavax.validation.ConstraintDeclarationException - HV000151: A method overriding another method must not redefine the parameter constraint configuration
exception as the interface defines no constraints, but the implementation now does.Adding the constraint to the interface is no solution as for one class of objects I might need different object validation than for another while they still inherit from the BaseEnityDto interface. Besides, I want just the end-state of the object validated (and then depending on the applicable validation group), not the intermediate states!
I've raised this issue also with Lombok: projectlombok/lombok#3180
The text was updated successfully, but these errors were encountered: