package yn;

import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

/* loaded from: classes3.dex */
final class c {

    /* renamed from: a, reason: collision with root package name */
    public static final c f52861a = new c();

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

    /* loaded from: classes3.dex */
    public static final class a {

        /* renamed from: a, reason: collision with root package name */
        private final Method f52863a;

        /* renamed from: b, reason: collision with root package name */
        private final Method f52864b;

        public a(Method method, Method method2) {
            this.f52863a = method;
            this.f52864b = method2;
        }

        public final Method a() {
            return this.f52864b;
        }

        public final Method b() {
            return this.f52863a;
        }
    }

    private c() {
    }

    public final a a(Member member) {
        kotlin.jvm.internal.t.g(member, "member");
        Class<?> cls = member.getClass();
        try {
            return new a(cls.getMethod("getParameters", new Class[0]), d.f(cls).loadClass("java.lang.reflect.Parameter").getMethod("getName", new Class[0]));
        } catch (NoSuchMethodException unused) {
            return new a(null, null);
        }
    }

    public final List b(Member member) {
        Method a10;
        kotlin.jvm.internal.t.g(member, "member");
        a aVar = f52862b;
        if (aVar == null) {
            synchronized (this) {
                aVar = f52862b;
                if (aVar == null) {
                    aVar = f52861a.a(member);
                    f52862b = aVar;
                }
            }
        }
        Method b10 = aVar.b();
        if (b10 == null || (a10 = aVar.a()) == null) {
            return null;
        }
        Object invoke = b10.invoke(member, new Object[0]);
        kotlin.jvm.internal.t.e(invoke, "null cannot be cast to non-null type kotlin.Array<*>");
        Object[] objArr = (Object[]) invoke;
        ArrayList arrayList = new ArrayList(objArr.length);
        for (Object obj : objArr) {
            Object invoke2 = a10.invoke(obj, new Object[0]);
            kotlin.jvm.internal.t.e(invoke2, "null cannot be cast to non-null type kotlin.String");
            arrayList.add((String) invoke2);
        }
        return arrayList;
    }
}
