Rolling out @Nullable
Jesse Wilson
1643

Great article! Informative and concise.

I would like to add that the related practice of adding \@NonNull annotations to methods is not a very good practice (too much boilerplate, and no way to ensure consistency).

Better use a convention that any argument or return value which is not \@Nullable is assumed to be non-null, and don’t perform null checks for them.

If you’re adding \@NonNull’s in order to enable automatic detection of null violations, then you can have that functionality without \@NonNull’s using a trick described here: https://metabroadcast.com/blog/getting-intellij-to-dislike-nulls-as-much-as-the-rest-of-us

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.