-
Notifications
You must be signed in to change notification settings - Fork 331
Stream handling failing when using multiple filters #1492
Copy link
Copy link
Open
Labels
Description
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.
Reactions are currently unavailable