jenkins-bot has submitted this change and it was merged. Change subject: Set date format when building default Gson to prevent crash ......................................................................
Set date format when building default Gson to prevent crash I have not been able to reproduce this crash, but it seems Gson has a problem parsing date strings when unmarshalling tab data. From the info I've looked at online, explicitly defining a date format will prevent ParseExceptions here: https://stackoverflow.com/questions/7816586/gson-java-text- parseexception-unparseable-date https://stackoverflow.com/questions/33408620/java-gson-java-text- parseexception-unparseable-date Bug: T118575 Change-Id: I516e7352f4997703d250980b3e94e5aa88f7ad46 --- M app/src/main/java/org/wikipedia/data/GsonUtil.java 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Dbrant: Looks good to me, approved Niedzielski: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/app/src/main/java/org/wikipedia/data/GsonUtil.java b/app/src/main/java/org/wikipedia/data/GsonUtil.java index 35c7194..9ffc5cc 100644 --- a/app/src/main/java/org/wikipedia/data/GsonUtil.java +++ b/app/src/main/java/org/wikipedia/data/GsonUtil.java @@ -4,7 +4,8 @@ import com.google.gson.GsonBuilder; public final class GsonUtil { - private static final Gson DEFAULT_GSON = new GsonBuilder().create(); + private static final String DATE_FORMAT = "MMM dd, yyyy HH:mm:ss"; + private static final Gson DEFAULT_GSON = new GsonBuilder().setDateFormat(DATE_FORMAT).create(); public static Gson getDefaultGson() { return DEFAULT_GSON; -- To view, visit https://gerrit.wikimedia.org/r/254188 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I516e7352f4997703d250980b3e94e5aa88f7ad46 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Mholloway <[email protected]> Gerrit-Reviewer: BearND <[email protected]> Gerrit-Reviewer: Brion VIBBER <[email protected]> Gerrit-Reviewer: Dbrant <[email protected]> Gerrit-Reviewer: Mholloway <[email protected]> Gerrit-Reviewer: Niedzielski <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
