Remove redundant null checks used with "instanceof"

SonarLint reports:

Null checks should not be used with "instanceof" (squid:S4201)

There's no need to null test in conjunction with an instanceof test.
null is not an instanceof anything, so a null check is redundant.

Change-Id: I29506aebfe337c8c300b46179e43b3057d9ae370
This commit is contained in:
David Pursehouse
2020-02-19 17:49:06 +09:00
parent b715bb82a4
commit d6eb1c29a8
4 changed files with 4 additions and 6 deletions

View File

@@ -37,9 +37,7 @@ public class AndChangeSource extends AndSource<ChangeData> implements ChangeData
@Override
public boolean hasChange() {
return source != null
&& source instanceof ChangeDataSource
&& ((ChangeDataSource) source).hasChange();
return source instanceof ChangeDataSource && ((ChangeDataSource) source).hasChange();
}
@Override