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
Freefair lombok 6.4.3+lombok 1.8.24 introduces javax.validation inconsistencies #941
Comments
workaround for adaptris/interlok#941
ConnectedService as an interface is fine; it's just declaring method availability not behaviour, some implementations care that the connection is not null, other implmentations don't so we can't always decide at the interface level what to enforce. Probably downgrade to 1.8.22 is the "least work since there's only 5 affected projects" but that leaves us with the situation where those projects can't use features post 1.8.24 |
projectlombok/lombok#3180 is the umbrella issue for this. |
This is caused by the recently released projectlombok 1.18.24 release which has the release notes :
1.18.24 is introduced because of freefair lombok upgrade from 6.4.2 to 6.4.3. The symptom can be seen in this PR : adaptris/interlok-aws#900
You have a class that implements ConnectedService and you use 'lombok' so you annotated it like this
This leads to the generated code
Which now differs in signature from what's defined in the ConnectedService. Which, when you run an XMLRoundTrip validation test gives you a a HV000151 hibernator validator exception.
This is because javax.validation.ConstraintDeclarationException is raised if you add parameter constraints to a method which overrides or implements a super-type method. This behavior is mandated by the Bean Validation spec (see http://beanvalidation.org/1.1/spec/#constraintdeclarationvalidationprocess-methodlevelconstraints-inheritance)
Solution 1 (changes to the "most files").
Modify the ConnectedService interface to add the @NotNull annotations, since pretty much all services that have connections will have those set to be not null. If the default is 'null-connection' then we should just default it and accept the XML clutter; we'd also need to review all the implementations of ConnectedService and provide sensible defaults if it really could be null.
Solution 2 (least change, but breaks future upgradeability)
Modify all the build.gradle files such that, and keep monitoring the change log, they may end up adding a config item to disable the generation (raise a PR on lombok itself)
Solution 3 (safest)?
Modify the projects that are currently failing with 6.4.3 to remove the
@Getter/@Setter
annotation from the connection, and maintain the boilerplateAll 3 solutions have their issues
The text was updated successfully, but these errors were encountered: