package org.wikipedia.data;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public final class GsonUtil {
    private static final Gson DEFAULT_GSON = new GsonBuilder().create();

    public static Gson getDefaultGson() {
        return DEFAULT_GSON;
    }

    private GsonUtil() { }
}

package org.wikipedia.data;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public final class GsonUtil {
    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;
    }

    private GsonUtil() { }
}

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
