In our open source constraint solver (OptaPlanner), I want to use @NonNull
to make it more Kotlin friendly and clearer to use from Java, too.
spring-core
already uses @NonNull
, for example in this code. They effectively state for every method parameter if it's nullable or not, as explained here.
Which maven/gradle dependency should I use to have the class javax.annotation.Nonnull
in my classpath? Which one do the spring guys use? For example, I don't see the findbugs JSR-305 jar in their dependency list.
(And can I have it as an optional dependency to avoid bloating my user's classpath?)