This is more a suggestion to improve than a question.
We all know about Tony Hoare's โbillion dollar mistakeโ when inventing the zero link. Google Tips on the guava library wiki to avoid using null .
I really appreciate the Spring Data project, and we use Spring Data MongoDB in many projects. Is it likely that you will replace all possible null return reference values โโwith Optional<T> ? I think this will be a big improvement when using Spring Data repository abstraction.
I know that many interfaces will need to be changed, but the code changes are almost trivial, just return the return type to Optional.of(returnValue) .
source share