@NotNull vs @Nonnull


The latter appears to be standard but it seems kotlin only recognises the IntelliJ-specific former form? Is that intentional or a bug?

It would be nice if I could say “assume everything in this namespace is non-null by default except for things marked @Nullable”. I have a codebase where things (mostly return values and parameters) that can be null are marked as such, and everything else isn’t annotated.


We do not support annotations from JSR 305 (which is not a standard, because it never shipped) yet, but we will eventually.

As of having default nullability for whole libraries, this makes total sense indeed, thanks for the suggestion.