package org.joda.time;

import java.text.DateFormatSymbols;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import org.joda.time.chrono.ISOChronology;
import y.x0;

/* loaded from: classes.dex */
public abstract class c {

    /* renamed from: a, reason: collision with root package name */
    public static final a f31903a;

    /* renamed from: b, reason: collision with root package name */
    private static volatile a f31904b;

    /* renamed from: c, reason: collision with root package name */
    private static final AtomicReference f31905c;

    /* loaded from: classes.dex */
    public interface a {
        long getMillis();
    }

    /* loaded from: classes.dex */
    static class b implements a {
        b() {
        }

        @Override // org.joda.time.c.a
        public long getMillis() {
            return System.currentTimeMillis();
        }
    }

    static {
        b bVar = new b();
        f31903a = bVar;
        f31904b = bVar;
        f31905c = new AtomicReference();
    }

    private static Map a() {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        DateTimeZone dateTimeZone = DateTimeZone.f31852p;
        linkedHashMap.put("UT", dateTimeZone);
        linkedHashMap.put("UTC", dateTimeZone);
        linkedHashMap.put("GMT", dateTimeZone);
        i(linkedHashMap, "EST", "America/New_York");
        i(linkedHashMap, "EDT", "America/New_York");
        i(linkedHashMap, "CST", "America/Chicago");
        i(linkedHashMap, "CDT", "America/Chicago");
        i(linkedHashMap, "MST", "America/Denver");
        i(linkedHashMap, "MDT", "America/Denver");
        i(linkedHashMap, "PST", "America/Los_Angeles");
        i(linkedHashMap, "PDT", "America/Los_Angeles");
        return Collections.unmodifiableMap(linkedHashMap);
    }

    public static final long b() {
        return f31904b.getMillis();
    }

    public static final org.joda.time.a c(org.joda.time.a aVar) {
        return aVar == null ? ISOChronology.T() : aVar;
    }

    public static final DateFormatSymbols d(Locale locale) {
        try {
            return (DateFormatSymbols) DateFormatSymbols.class.getMethod("getInstance", Locale.class).invoke(null, locale);
        } catch (Exception unused) {
            return new DateFormatSymbols(locale);
        }
    }

    public static final Map e() {
        AtomicReference atomicReference = f31905c;
        Map map = (Map) atomicReference.get();
        if (map != null) {
            return map;
        }
        Map a10 = a();
        return !x0.a(atomicReference, null, a10) ? (Map) atomicReference.get() : a10;
    }

    public static final org.joda.time.a f(g gVar) {
        org.joda.time.a d10;
        return (gVar == null || (d10 = gVar.d()) == null) ? ISOChronology.T() : d10;
    }

    public static final long g(g gVar) {
        return gVar == null ? b() : gVar.getMillis();
    }

    public static final DateTimeZone h(DateTimeZone dateTimeZone) {
        return dateTimeZone == null ? DateTimeZone.k() : dateTimeZone;
    }

    private static void i(Map map, String str, String str2) {
        try {
            map.put(str, DateTimeZone.f(str2));
        } catch (RuntimeException unused) {
        }
    }
}
