mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
Avoid string concatenation in String.format
This commit is contained in:
parent
5d9bf309c9
commit
d301089f3c
@ -371,7 +371,7 @@ public class ImapStore extends Store {
|
|||||||
LinkedList<Folder> folders = new LinkedList<Folder>();
|
LinkedList<Folder> folders = new LinkedList<Folder>();
|
||||||
|
|
||||||
List<ImapResponse> responses =
|
List<ImapResponse> responses =
|
||||||
connection.executeSimpleCommand(String.format(commandResponse + " \"\" %s",
|
connection.executeSimpleCommand(String.format("%s \"\" %s", commandResponse,
|
||||||
encodeString(getCombinedPrefix() + "*")));
|
encodeString(getCombinedPrefix() + "*")));
|
||||||
|
|
||||||
for (ImapResponse response : responses) {
|
for (ImapResponse response : responses) {
|
||||||
@ -639,7 +639,7 @@ public class ImapStore extends Store {
|
|||||||
// 2 OK [READ-WRITE] Select completed.
|
// 2 OK [READ-WRITE] Select completed.
|
||||||
try {
|
try {
|
||||||
msgSeqUidMap.clear();
|
msgSeqUidMap.clear();
|
||||||
String command = String.format((mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE") + " %s",
|
String command = String.format("%s %s", mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE",
|
||||||
encodeString(encodeFolderName(getPrefixedName())));
|
encodeString(encodeFolderName(getPrefixedName())));
|
||||||
|
|
||||||
List<ImapResponse> responses = executeSimpleCommand(command);
|
List<ImapResponse> responses = executeSimpleCommand(command);
|
||||||
@ -896,7 +896,7 @@ public class ImapStore extends Store {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
int start = 1;
|
int start = 1;
|
||||||
|
|
||||||
List<ImapResponse> responses = executeSimpleCommand(String.format("SEARCH %d:* " + criteria, start));
|
List<ImapResponse> responses = executeSimpleCommand(String.format("SEARCH %d:* %s", start, criteria));
|
||||||
for (ImapResponse response : responses) {
|
for (ImapResponse response : responses) {
|
||||||
if (ImapResponseParser.equalsIgnoreCase(response.get(0), "SEARCH")) {
|
if (ImapResponseParser.equalsIgnoreCase(response.get(0), "SEARCH")) {
|
||||||
count += response.size() - 1;
|
count += response.size() - 1;
|
||||||
@ -973,7 +973,7 @@ public class ImapStore extends Store {
|
|||||||
|
|
||||||
ImapSearcher searcher = new ImapSearcher() {
|
ImapSearcher searcher = new ImapSearcher() {
|
||||||
public List<ImapResponse> search() throws IOException, MessagingException {
|
public List<ImapResponse> search() throws IOException, MessagingException {
|
||||||
return executeSimpleCommand(String.format("UID SEARCH %d:%d%s" + (includeDeleted ? "" : " NOT DELETED"), start, end, dateSearchString));
|
return executeSimpleCommand(String.format("UID SEARCH %d:%d%s%s", start, end, dateSearchString, includeDeleted ? "" : " NOT DELETED"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return search(searcher, listener);
|
return search(searcher, listener);
|
||||||
@ -983,7 +983,7 @@ public class ImapStore extends Store {
|
|||||||
throws MessagingException {
|
throws MessagingException {
|
||||||
ImapSearcher searcher = new ImapSearcher() {
|
ImapSearcher searcher = new ImapSearcher() {
|
||||||
public List<ImapResponse> search() throws IOException, MessagingException {
|
public List<ImapResponse> search() throws IOException, MessagingException {
|
||||||
return executeSimpleCommand(String.format("UID SEARCH %s" + (includeDeleted ? "" : " NOT DELETED"), Utility.combine(mesgSeqs.toArray(), ',')));
|
return executeSimpleCommand(String.format("UID SEARCH %s%s", Utility.combine(mesgSeqs.toArray(), ','), includeDeleted ? "" : " NOT DELETED"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return search(searcher, listener);
|
return search(searcher, listener);
|
||||||
@ -993,7 +993,7 @@ public class ImapStore extends Store {
|
|||||||
throws MessagingException {
|
throws MessagingException {
|
||||||
ImapSearcher searcher = new ImapSearcher() {
|
ImapSearcher searcher = new ImapSearcher() {
|
||||||
public List<ImapResponse> search() throws IOException, MessagingException {
|
public List<ImapResponse> search() throws IOException, MessagingException {
|
||||||
return executeSimpleCommand(String.format("UID SEARCH UID %s" + (includeDeleted ? "" : " NOT DELETED"), Utility.combine(mesgUids.toArray(), ',')));
|
return executeSimpleCommand(String.format("UID SEARCH UID %s%s", Utility.combine(mesgUids.toArray(), ','), includeDeleted ? "" : " NOT DELETED"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return search(searcher, listener);
|
return search(searcher, listener);
|
||||||
|
Loading…
Reference in New Issue
Block a user