From a85ea2ee53c7aceb6baa2d4ab83bfd07ab75b054 Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 3 Sep 2010 15:32:25 +0000 Subject: [PATCH] - Reworked the previous patch with suggestions by jessev to be as runtime/memory efficient as possible without being useless. - Output debug message when invalid responses are encountered. --- src/com/fsck/k9/mail/store/ImapStore.java | 26 ++++++++++------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 94cee36a1..418fcb8a0 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -936,25 +936,21 @@ public class ImapStore extends Store * * See issue 2078 */ + boolean invalidResponse = false; for (int i = 1, length = response.size(); i < length; i++) { - Object item = response.get(i); - if (item instanceof String) + if ("0".equals(response.get(i))) { - try - { - // Message sequence number is an unsigned 32-bit number. - long msgSeqNum = Long.parseLong((String)item); - - // TODO: Make sure the number isn't larger than the number of - // messages in the folder rather than < 2^32. - if ((msgSeqNum > 0) && (msgSeqNum < (1L << 32))) - { - count++; - } - } - catch (NumberFormatException e) {} + invalidResponse = true; } + else + { + count++; + } + } + if (K9.DEBUG && invalidResponse) + { + Log.d(K9.LOG_TAG, "Invalid value found in SEARCH response."); } } }