mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-12 06:08:25 -05:00
Fix LocalMessage equality/hash
This commit is contained in:
parent
40041ac0e0
commit
b644194a3d
@ -116,8 +116,6 @@ public class LocalFolder extends Folder<LocalMessage> implements Serializable {
|
||||
return getAccount().syncRemoteDeletions();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void open(final int mode) throws MessagingException {
|
||||
|
||||
|
@ -601,14 +601,18 @@ public class LocalMessage extends MimeMessage {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
|
||||
LocalMessage that = (LocalMessage) o;
|
||||
return !(getUid() != null ? !getUid().equals(that.getUid()) : that.getUid() != null);
|
||||
final LocalMessage that = (LocalMessage) o;
|
||||
return !(getAccountUuid() != null ? !getAccountUuid().equals(that.getAccountUuid()) : that.getAccountUuid() != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = super.hashCode();
|
||||
result = 31 * result + (getUid() != null ? getUid().hashCode() : 0);
|
||||
result = 31 * result + (getAccountUuid() != null ? getAccountUuid().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getAccountUuid() {
|
||||
return getAccount().getUuid();
|
||||
}
|
||||
}
|
@ -47,8 +47,8 @@ public abstract class Message implements Part, CompositeBody {
|
||||
return false;
|
||||
}
|
||||
Message other = (Message)o;
|
||||
return (mUid.equals(other.getUid())
|
||||
&& mFolder.getName().equals(other.getFolder().getName()));
|
||||
return (getUid().equals(other.getUid())
|
||||
&& getFolder().getName().equals(other.getFolder().getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user