Refactor ChannelTab.equals

This commit is contained in:
Eric Xu 2021-05-22 00:22:44 -04:00 committed by Zhiheng Xu
parent d2b03afcf4
commit 14bbaccb9f
1 changed files with 8 additions and 3 deletions

View File

@ -446,9 +446,14 @@ public abstract class Tab {
@Override @Override
public boolean equals(final Object obj) { public boolean equals(final Object obj) {
return super.equals(obj) && channelServiceId == ((ChannelTab) obj).channelServiceId if (!(obj instanceof ChannelTab)) {
&& Objects.equals(channelUrl, ((ChannelTab) obj).channelUrl) return false;
&& Objects.equals(channelName, ((ChannelTab) obj).channelName); }
final ChannelTab other = (ChannelTab) obj;
return super.equals(obj)
&& channelServiceId == other.channelServiceId
&& channelUrl.equals(other.channelName)
&& channelName.equals(other.channelName);
} }
public int getChannelServiceId() { public int getChannelServiceId() {