The return value from a method is dereferenced without a null check,
and the return value of that method is one that should generally be checked for null (which requires to use Findbugs annotations to express the developer's intend).
This may lead to a NullPointerException
when the code is executed.
public long getTime() { return getDate().getTime(); // NullPointerException may occur } @CheckForNull // See javax.annotation.CheckForNull (JSR-305) public Date getDate() { /* ... */ }
public long getTime() { Date date = getDate(); if (date == null) { throw new IllegalStateException("..."); } return date.getTime(); } @CheckForNull // See javax.annotation.CheckForNull (JSR-305) public Date getDate() { /* ... */ }