Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit c283449d authored by Sander Bogaert's avatar Sander Bogaert Committed by Jesse Vincent
Browse files

Added another badDateTimeFormat to ImapResponseParser.

Some IMAP servers generate timestamps without timezones. :/

Fixes gcode issue 3179
parent 939660fa
Branches
Tags
No related merge requests found
......@@ -15,6 +15,7 @@ public class ImapResponseParser {
private static final SimpleDateFormat mDateTimeFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss Z", Locale.US);
private static final SimpleDateFormat badDateTimeFormat = new SimpleDateFormat("dd MMM yyyy HH:mm:ss Z", Locale.US);
private static final SimpleDateFormat badDateTimeFormat2 = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z", Locale.US);
private static final SimpleDateFormat badDateTimeFormat3 = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss", Locale.US);
private PeekableInputStream mIn;
private ImapResponse mResponse;
......@@ -426,8 +427,14 @@ public class ImapResponseParser {
return badDateTimeFormat.parse(value);
}
} catch (Exception e2) {
synchronized (badDateTimeFormat2) {
return badDateTimeFormat2.parse(value);
try {
synchronized (badDateTimeFormat2) {
return badDateTimeFormat2.parse(value);
}
} catch (Exception e3) {
synchronized (badDateTimeFormat3) {
return badDateTimeFormat3.parse(value);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment