use TextUtils.equals in new equals() overrides

This commit is contained in:
Eric House 2017-08-02 07:00:34 -07:00
parent 4ec930d53c
commit 455b6e79f0
4 changed files with 20 additions and 34 deletions

View file

@ -25,6 +25,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import java.io.InputStream;
import java.io.Serializable;
@ -328,24 +329,17 @@ public class NetLaunchInfo implements Serializable {
boolean result = null != obj && obj instanceof NetLaunchInfo;
if ( result ) {
other = (NetLaunchInfo)obj;
result = ((null == gameName) ? (null == other.gameName)
: gameName.equals(other.gameName))
&& ((null == dict) ? (null == other.dict)
: dict.equals(other.dict))
result = TextUtils.equals( gameName, other.gameName )
&& TextUtils.equals( dict, other.dict )
&& lang == other.lang
&& forceChannel == other.forceChannel
&& nPlayersT == other.nPlayersT
&& nPlayersH == other.nPlayersH
&& ((null == room) ? (null == other.room)
: room.equals(other.room))
&& ((null == btName) ? (null == other.btName)
: btName.equals(other.btName))
&& ((null == btAddress) ? (null == other.btAddress)
: btAddress.equals(other.btAddress))
&& ((null == p2pMacAddress) ? (null == other.p2pMacAddress)
: p2pMacAddress.equals(other.p2pMacAddress))
&& ((null == phone) ? (null == other.phone)
: phone.equals(other.phone))
&& TextUtils.equals( room, other.room )
&& TextUtils.equals( btName, other.btName )
&& TextUtils.equals( btAddress, other.btAddress )
&& TextUtils.equals( p2pMacAddress, other.p2pMacAddress )
&& TextUtils.equals( phone, other.phone )
&& isGSM == other. isGSM
&& osVers == other.osVers
&& _conTypes == other._conTypes
@ -353,8 +347,7 @@ public class NetLaunchInfo implements Serializable {
&& ((null == m_addrs ? (null == other.m_addrs)
: m_addrs.equals(other.m_addrs)))
&& m_valid == other.m_valid
&& ((null == inviteID ? (null == other.inviteID)
: inviteID.equals(other.inviteID)))
&& TextUtils.equals( inviteID, other.inviteID )
;
}
return result;

View file

@ -21,6 +21,7 @@
package org.eehouse.android.xw4.jni;
import android.content.Context;
import android.text.TextUtils;
import java.io.Serializable;
import java.util.Arrays;
@ -294,14 +295,12 @@ public class CurGameInfo implements Serializable {
&& allowHintRect == other.allowHintRect
&& m_smartness == other.m_smartness
&& Arrays.deepEquals( players, other.players )
&& ((null == dictName) ? (null == other.dictName)
: dictName.equals(other.dictName))
&& TextUtils.equals( dictName, other.dictName )
&& ((null == serverRole) ? (null == other.serverRole)
: serverRole.equals(other.serverRole))
&& ((null == phoniesAction) ? (null == other.phoniesAction)
: phoniesAction.equals(other.phoniesAction))
&& ((null == m_name) ? (null == other.m_name)
: m_name.equals(other.m_name))
&& TextUtils.equals( m_name, other.m_name )
;
}
} else {

View file

@ -125,22 +125,18 @@ public class GameSummary implements Serializable {
&& Arrays.equals( m_players, other.m_players )
&& ((null == conTypes) ? (null == other.conTypes)
: conTypes.equals(other.conTypes))
&& ((null == roomName) ? (null == other.roomName)
: roomName.equals(other.roomName))
&& ((null == relayID) ? (null == other.relayID)
: relayID.equals(other.relayID))
&& TextUtils.equals( roomName, other.roomName )
&& TextUtils.equals( relayID, other.relayID )
&& Arrays.equals( remoteDevs, other.remoteDevs )
&& ((null == serverRole) ? (null == other.serverRole)
: serverRole.equals(other.serverRole))
&& ((null == m_giFlags) ? (null == other.m_giFlags)
: m_giFlags.equals(other.m_giFlags))
&& ((null == m_playersSummary) ? (null == other.m_playersSummary)
: m_playersSummary.equals(other.m_playersSummary))
&& TextUtils.equals( m_playersSummary, other.m_playersSummary )
&& ((null == m_gi) ? (null == other.m_gi)
: m_gi.equals(other.m_gi))
&& Arrays.equals( m_remotePhones, other.m_remotePhones )
&& ((null == m_extras) ? (null == other.m_extras)
: m_extras.equals(other.m_extras))
&& TextUtils.equals( m_extras, other.m_extras )
;
}
} else {

View file

@ -21,6 +21,7 @@
package org.eehouse.android.xw4.jni;
import android.content.Context;
import android.text.TextUtils;
import java.io.Serializable;
@ -73,12 +74,9 @@ public class LocalPlayer implements Serializable {
result = secondsUsed == other.secondsUsed
&& robotIQ == other.robotIQ
&& isLocal == other.isLocal
&& ((null == name) ? (null == other.name)
: name.equals(other.name))
&& ((null == password) ? (null == other.password)
: password.equals(other.password))
&& ((null == dictName) ? (null == other.dictName)
: dictName.equals(other.dictName))
&& TextUtils.equals( name, other.name )
&& TextUtils.equals( password, other.password )
&& TextUtils.equals( dictName, other.dictName )
;
}
} else {