[java] UnusedNullCheckInEquals false positive when Objects.equals is used
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Hi,
thanks for reporting.
I think, PMD is suggesting, since you already checked that
userId
is not null, you should use the equals method of this object:return userId != null && userId.equals(series.getCreatedBy())
It seems, you can't just use Objects.equals as-is, since you don't want to allow access if both the userId and series.getCreatedBy() would be null.
Does this make sense?