From 61c850e077caabea16e5a1839640119e5aa09d94 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 2 Nov 2011 22:02:41 -0700 Subject: [PATCH] Remove dead stores Addresses FindBugs complaints. --- src/com/fsck/k9/mail/store/Pop3Store.java | 4 ++-- src/com/fsck/k9/mail/store/WebDavStore.java | 24 +++++++-------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index 8f017f870..db9c227a0 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -740,8 +740,8 @@ public class Pop3Store extends Store { } if (response == null) { - response = executeSimpleCommand(String.format(RETR_COMMAND + " %d", - mUidToMsgNumMap.get(message.getUid()))); + executeSimpleCommand(String.format(RETR_COMMAND + " %d", + mUidToMsgNumMap.get(message.getUid()))); } try { diff --git a/src/com/fsck/k9/mail/store/WebDavStore.java b/src/com/fsck/k9/mail/store/WebDavStore.java index 4f2e87e62..a854e857f 100644 --- a/src/com/fsck/k9/mail/store/WebDavStore.java +++ b/src/com/fsck/k9/mail/store/WebDavStore.java @@ -1203,7 +1203,6 @@ public class WebDavStore extends Store { private int getMessageCount(boolean read) throws MessagingException { String isRead; int messageCount = 0; - DataSet dataset = new DataSet(); HashMap headers = new HashMap(); String messageBody; @@ -1215,7 +1214,7 @@ public class WebDavStore extends Store { messageBody = getMessageCountXml(isRead); headers.put("Brief", "t"); - dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); + DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); if (dataset != null) { messageCount = dataset.getMessageCount(); } @@ -1292,7 +1291,6 @@ public class WebDavStore extends Store { throws MessagingException { ArrayList messages = new ArrayList(); String[] uids; - DataSet dataset = new DataSet(); HashMap headers = new HashMap(); int uidsLength = -1; @@ -1316,7 +1314,7 @@ public class WebDavStore extends Store { headers.put("Brief", "t"); headers.put("Range", "rows=" + start + "-" + end); - dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); + DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); uids = dataset.getUids(); HashMap uidToUrl = dataset.getUidToUrl(); @@ -1371,17 +1369,15 @@ public class WebDavStore extends Store { } private HashMap getMessageUrls(String[] uids) throws MessagingException { - HashMap uidToUrl = new HashMap(); HashMap headers = new HashMap(); - DataSet dataset = new DataSet(); String messageBody; /** Retrieve and parse the XML entity for our messages */ messageBody = getMessageUrlsXml(uids); headers.put("Brief", "t"); - dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); - uidToUrl = dataset.getUidToUrl(); + DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); + HashMap uidToUrl = dataset.getUidToUrl(); return uidToUrl; } @@ -1531,9 +1527,7 @@ public class WebDavStore extends Store { * we do a series of medium calls instead of one large massive call or a large number of smaller calls. */ private void fetchFlags(Message[] startMessages, MessageRetrievalListener listener) throws MessagingException { - HashMap uidToReadStatus = new HashMap(); HashMap headers = new HashMap(); - DataSet dataset = new DataSet(); String messageBody = ""; Message[] messages = new Message[20]; String[] uids; @@ -1566,13 +1560,13 @@ public class WebDavStore extends Store { messageBody = getMessageFlagsXml(uids); headers.put("Brief", "t"); - dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); + DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); if (dataset == null) { throw new MessagingException("Data Set from request was null"); } - uidToReadStatus = dataset.getUidToRead(); + HashMap uidToReadStatus = dataset.getUidToRead(); for (int i = 0, count = messages.length; i < count; i++) { if (!(messages[i] instanceof WebDavMessage)) { @@ -1603,9 +1597,7 @@ public class WebDavStore extends Store { */ private void fetchEnvelope(Message[] startMessages, MessageRetrievalListener listener) throws MessagingException { - HashMap envelopes = new HashMap(); HashMap headers = new HashMap(); - DataSet dataset = new DataSet(); String messageBody = ""; String[] uids; Message[] messages = new Message[10]; @@ -1638,9 +1630,9 @@ public class WebDavStore extends Store { messageBody = getMessageEnvelopeXml(uids); headers.put("Brief", "t"); - dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); + DataSet dataset = processRequest(this.mFolderUrl, "SEARCH", messageBody, headers); - envelopes = dataset.getMessageEnvelopes(); + Map envelopes = dataset.getMessageEnvelopes(); int count = messages.length; for (int i = messages.length - 1; i >= 0; i--) {