1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-02 00:25:10 -04:00

Code cleanup: Fixed some warnings

This commit is contained in:
cketti 2010-05-03 13:46:55 +00:00
parent 4290b74e86
commit 683f31e32e
4 changed files with 29 additions and 2 deletions

View File

@ -83,12 +83,14 @@ public class MessagingControllerPushReceiver implements PushReceiver
final CountDownLatch latch = new CountDownLatch(1);
controller.synchronizeMailbox(account, folder.getName(), new MessagingListener()
{
@Override
public void synchronizeMailboxFinished(Account account, String folder,
int totalMessagesInMailbox, int numNewMessages)
{
latch.countDown();
}
@Override
public void synchronizeMailboxFailed(Account account, String folder,
String message)
{

View File

@ -36,8 +36,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

View File

@ -8,6 +8,7 @@ public class MessageReference implements Serializable
public String folderName;
public String uid;
@Override
public boolean equals(Object o)
{
if (o instanceof MessageReference == false)
@ -23,6 +24,20 @@ public class MessageReference implements Serializable
}
return false;
}
@Override
public int hashCode()
{
final int MULTIPLIER = 31;
int result = 1;
result = MULTIPLIER * result + ((accountUuid == null) ? 0 : accountUuid.hashCode());
result = MULTIPLIER * result + ((folderName == null) ? 0 : folderName.hashCode());
result = MULTIPLIER * result + ((uid == null) ? 0 : uid.hashCode());
return result;
}
@Override
public String toString()
{
return "MessageReference{accountUuid = '" +

View File

@ -23,6 +23,7 @@ public abstract class Message implements Part, Body
protected Folder mFolder;
@Override
public boolean equals(Object o)
{
if (o == null || o instanceof Message == false)
@ -35,6 +36,17 @@ public abstract class Message implements Part, Body
&& mUid.equals(other.getUid()));
}
@Override
public int hashCode()
{
final int MULTIPLIER = 31;
int result = 1;
result = MULTIPLIER * result + mFolder.getName().hashCode();
result = MULTIPLIER * result + mFolder.getAccount().getUuid().hashCode();
result = MULTIPLIER * result + mUid.hashCode();
return result;
}
public String getUid()
{