Refactor KioskTab.equals

This commit is contained in:
Eric Xu 2021-05-22 00:13:17 -04:00 committed by Zhiheng Xu
parent 01aab25889
commit 1cac3895dc
1 changed files with 7 additions and 2 deletions

View File

@ -362,8 +362,13 @@ public abstract class Tab {
@Override
public boolean equals(final Object obj) {
return super.equals(obj) && kioskServiceId == ((KioskTab) obj).kioskServiceId
&& Objects.equals(kioskId, ((KioskTab) obj).kioskId);
if (!(obj instanceof KioskTab)) {
return false;
}
final KioskTab other = (KioskTab) obj;
return super.equals(obj)
&& kioskServiceId == other.kioskServiceId
&& kioskId.equals(other.kioskId);
}
public int getKioskServiceId() {