New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Duplicate @Valid constraint validation on @Data class after update from 1.18.22 to 1.18.24 #3304
Comments
Sorry for the delay. Looks like in 1.18.24, lombok takes the @NotNull and applies it to the property setter. This doesn't happen in prior versions. When I delombok the source with 1.18.22 I see:
With 1.18.24 I see:
|
I confirm the issue since The "IMPROBABLE BREAKING CHANGE" mention in the changelog made me chuckle |
@dballardgh If you are interrested, the discussion on issue #3180 has more info about this |
This change was reverted in 1473389 which is part of 1.18.26. |
Describe the bug
A Lombok 1.18.24
@Data
class that is validated using Hibernate'shibernate-validator
results in constraints such as@NotNull
being validated twice. This doesn't happen with 1.18.22 or earlier versions.To Reproduce
I don't have a standalone test case yet. Working on it. In a nutshell:
Given
@Data
class:And a Spring MVC endpoint:
When a request is POSTed without a
name
:Expected behavior
Then I expect
bindingResult
to contain one error for fieldname
with messagePlease specify a name
.Actual behavior
The
bindingResult
contains two errors for fieldname
with messagePlease specify a name
.Version info (please complete the following information):
Additional context
I suspect, but I'm not sure yet, that property
name
and gettergetName()
are being validated with 1.18.24, but earlier versions are only validating one of them.The text was updated successfully, but these errors were encountered: