Since 1.8 Java has a type Optional which might or might not contain a not-null value. Best practice is to always call isPresent() before calling get() (similar to the annotation CheckForNull).
It would be nice to have a FindBugs-rule which enforces this practice.
@Andrey: I took the liberty to set the milestone and owner according to [feature-requests:#297], by which this ticket is inspired.
Log in to post a comment.