Here is a method in my project where NullAway is reporting [NullAway] dereferenced expression re.getValue() is @Nullable in the second filter.
public List<RelatedEntity> filterByRoleAndServiceSpecificationName(List<RelatedEntity> relatedEntities,SERVICE_SPECIFICATION serviceSpecName) {
return relatedEntities.stream()
.filter(re -> nonNull(re) && nonNull(re.getValue()) && nonNull(re.getValue().getServiceSpecification()))
.filter(re -> serviceSpecName.value.equalsIgnoreCase(re.getValue().getServiceSpecification().getName()))
.collect(Collectors.toList());
}
It seems to be recognizing that re was null checked because it does not report an error on dereferencing re, but it's not recognizing that re.getValue() has been checked.
Here is a method in my project where NullAway is reporting
[NullAway] dereferenced expression re.getValue() is @Nullablein the second filter.It seems to be recognizing that
rewas null checked because it does not report an error on dereferencingre, but it's not recognizing thatre.getValue()has been checked.