Question regarding Null annotation support. When o...
# announcements
m
Question regarding Null annotation support. When originally announced (https://blog.jetbrains.com/kotlin/2015/04/upcoming-change-more-null-safety-for-java/), support for javax.validation.constraints was listed. In some generated code, it has the javax.validation.constraints.NotNull annotation BUT IntelliJ and Kotlin aren't correctly detecting it. If I modify the generated code to use either org.jetbrains.annotations.NotNull or org.springframework.lang.NonNull or javax.annotation.Nonnull, they all work as expected. Was it decided to not include javax.validation.constraints in the list after all, or have I potentially found an issue? I haven't been able to find anything concrete on this topic so hoping someone here can provide some clarity.
They're not on the list
m
Missed that in docs. Thank you for the link. Time for an enhancement request...
h
I think those are intentionally left out: A validation constraint annotation does not indicate that a field is guaranteed to fulfill a constraint, it merely tells the validation framework to check if it does.
m
Thinking about it, i suspect you're right. Time to modify the code generator, or help fix the Kotlin generator. TY