package n3;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

/* JADX INFO: renamed from: n3.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0915b extends b5.a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Method f9356a = Class.class.getMethod("isRecord", new Class[0]);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Method f9357b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Method f9358c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Method f9359d;

    public C0915b() throws NoSuchMethodException {
        Method method = Class.class.getMethod("getRecordComponents", new Class[0]);
        this.f9357b = method;
        Class<?> componentType = method.getReturnType().getComponentType();
        this.f9358c = componentType.getMethod("getName", new Class[0]);
        this.f9359d = componentType.getMethod("getType", new Class[0]);
    }

    @Override // b5.a
    public final Method n(Class cls, Field field) {
        try {
            return cls.getMethod(field.getName(), new Class[0]);
        } catch (ReflectiveOperationException e2) {
            throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e2);
        }
    }

    @Override // b5.a
    public final Constructor o(Class cls) {
        try {
            Object[] objArr = (Object[]) this.f9357b.invoke(cls, new Object[0]);
            Class<?>[] clsArr = new Class[objArr.length];
            for (int i = 0; i < objArr.length; i++) {
                clsArr[i] = (Class) this.f9359d.invoke(objArr[i], new Object[0]);
            }
            return cls.getDeclaredConstructor(clsArr);
        } catch (ReflectiveOperationException e2) {
            throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e2);
        }
    }

    @Override // b5.a
    public final String[] t(Class cls) {
        try {
            Object[] objArr = (Object[]) this.f9357b.invoke(cls, new Object[0]);
            String[] strArr = new String[objArr.length];
            for (int i = 0; i < objArr.length; i++) {
                strArr[i] = (String) this.f9358c.invoke(objArr[i], new Object[0]);
            }
            return strArr;
        } catch (ReflectiveOperationException e2) {
            throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e2);
        }
    }

    @Override // b5.a
    public final boolean x(Class cls) {
        try {
            return ((Boolean) this.f9356a.invoke(cls, new Object[0])).booleanValue();
        } catch (ReflectiveOperationException e2) {
            throw new RuntimeException("Unexpected ReflectiveOperationException occurred (Gson 2.10.1). To support Java records, reflection is utilized to read out information about records. All these invocations happens after it is established that records exist in the JVM. This exception is unexpected behavior.", e2);
        }
    }
}
