Oliver Fischer
unread,Nov 1, 2024, 11:01:51 AM11/1/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Checker Framework discussion
Hi guys,
I just noticed a difference in handling the @Nullable annotion if I switch from classic Java Bean Validation to Jakarta Bean Validation.
Some background. I had a small Spring Boot 3 application, used as proof of concept. Spring Boot uses Jakarta Bean Validation instead of Java Bean Validation.
That means that Spring Boot 3 uses
jakarta.validation.constraints.NotNull;
while Spring Boot 2 uses
javax.validation.constraints.NotNull;
I have some methods annotated like this one:
public
@NotNull(message = "Image version must be given")
@NotBlank(message = "Image version name must not be blank")
@Nullable String getVersion() { return version; }
Using the javax.* annotations this leads to errors generated by the compiler using the Checker Framework. If I use the jakarta.* annotations, the compiler does not complain.
So, does the Checker Framework also consider the Bean Validation annotations? And is support for Jakarta currently not given?
Thank you in advance?
Oliver