1
0
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:
Jan Berkel 2014-12-12 15:16:38 +00:00
parent 40041ac0e0
commit b644194a3d
3 changed files with 9 additions and 7 deletions

View File

@ -116,8 +116,6 @@ public class LocalFolder extends Folder<LocalMessage> implements Serializable {
return getAccount().syncRemoteDeletions();
}
@Override
public void open(final int mode) throws MessagingException {

View File

@ -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();
}
}

View File

@ -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