by raytracer on 3/19/19, 11:50 AM with 1 comments
by adrianmsmith on 3/19/19, 12:01 PM
However, if you’re stuck with Java, which doesn’t do that, you can annotate your types with @Nonnull and @CheckForNull. (At least) SpotBugs and IntelliJ respect such annotations.
I have done this to every parameter type, return type, and instance variable on a 15 KLOC codebase and it’s been a great success.