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
public boolean equals(final Object obj) {
return super.equals(obj) && channelServiceId == ((ChannelTab) obj).channelServiceId
&& Objects.equals(channelUrl, ((ChannelTab) obj).channelUrl)
&& Objects.equals(channelName, ((ChannelTab) obj).channelName);
if (!(obj instanceof ChannelTab)) {
return false;
}
final ChannelTab other = (ChannelTab) obj;
return super.equals(obj)
&& channelServiceId == other.channelServiceId
&& channelUrl.equals(other.channelName)
&& channelName.equals(other.channelName);
}
public int getChannelServiceId() {