1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Prefer entrySet over keySet and get

Addresses FindBugs complaints.
This commit is contained in:
Andrew Gaul 2011-10-31 21:42:12 -07:00
parent c26ad2c4fd
commit bfd11c444f
2 changed files with 13 additions and 9 deletions

View File

@ -3276,9 +3276,11 @@ public class MessagingController implements Runnable {
localSrcFolder.copyMessages(messages, localDestFolder); localSrcFolder.copyMessages(messages, localDestFolder);
} else { } else {
localSrcFolder.moveMessages(messages, localDestFolder); localSrcFolder.moveMessages(messages, localDestFolder);
for (String origUid : origUidMap.keySet()) { for (Map.Entry<String, Message> entry : origUidMap.entrySet()) {
String origUid = entry.getKey();
Message message = entry.getValue();
for (MessagingListener l : getListeners()) { for (MessagingListener l : getListeners()) {
l.messageUidChanged(account, srcFolder, origUid, origUidMap.get(origUid).getUid()); l.messageUidChanged(account, srcFolder, origUid, message.getUid());
} }
unsuppressMessage(account, srcFolder, origUid); unsuppressMessage(account, srcFolder, origUid);
} }

View File

@ -51,6 +51,7 @@ import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
import java.util.Stack; import java.util.Stack;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
@ -944,8 +945,8 @@ public class WebDavStore extends Store {
} }
if (headers != null) { if (headers != null) {
for (String headerName : headers.keySet()) { for (Map.Entry<String, String> entry : headers.entrySet()) {
httpmethod.setHeader(headerName, headers.get(headerName)); httpmethod.setHeader(entry.getKey(), entry.getValue());
} }
} }
@ -2207,10 +2208,11 @@ public class WebDavStore extends Store {
HashMap<String, String> data = mData.get(uid); HashMap<String, String> data = mData.get(uid);
if (data != null) { if (data != null) {
for (String header : data.keySet()) { for (Map.Entry<String, String> entry : data.entrySet()) {
String header = entry.getKey();
if (header.equals("read")) { if (header.equals("read")) {
String read = data.get(header); String read = entry.getValue();
Boolean readStatus = !read.equals("0"); boolean readStatus = !read.equals("0");
envelope.setReadStatus(readStatus); envelope.setReadStatus(readStatus);
} else if (header.equals("date")) { } else if (header.equals("date")) {
@ -2219,7 +2221,7 @@ public class WebDavStore extends Store {
* yyyy-MM-dd'T'HH:mm:ss.SSS<Single digit representation of timezone, so far, all instances * yyyy-MM-dd'T'HH:mm:ss.SSS<Single digit representation of timezone, so far, all instances
* are Z> * are Z>
*/ */
String date = data.get(header); String date = entry.getValue();
date = date.substring(0, date.length() - 1); date = date.substring(0, date.length() - 1);
DateFormat dfInput = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US); DateFormat dfInput = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
@ -2234,7 +2236,7 @@ public class WebDavStore extends Store {
} }
envelope.addHeader(header, tempDate); envelope.addHeader(header, tempDate);
} else { } else {
envelope.addHeader(header, data.get(header)); envelope.addHeader(header, entry.getValue());
} }
} }
} }