98 lines
2.8 KiB
Java
98 lines
2.8 KiB
Java
package re;
|
|
|
|
import java.lang.reflect.Member;
|
|
import java.lang.reflect.Method;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import kotlin.jvm.internal.s;
|
|
/* compiled from: ReflectJavaMember.kt */
|
|
/* loaded from: classes5.dex */
|
|
final class c {
|
|
|
|
/* renamed from: a reason: collision with root package name */
|
|
public static final c f21902a = new c();
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
private static a f21903b;
|
|
|
|
/* compiled from: ReflectJavaMember.kt */
|
|
/* loaded from: classes5.dex */
|
|
public static final class a {
|
|
|
|
/* renamed from: a reason: collision with root package name */
|
|
private final Method f21904a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
private final Method f21905b;
|
|
|
|
public a(Method method, Method method2) {
|
|
this.f21904a = method;
|
|
this.f21905b = method2;
|
|
}
|
|
|
|
public final Method a() {
|
|
return this.f21905b;
|
|
}
|
|
|
|
public final Method b() {
|
|
return this.f21904a;
|
|
}
|
|
}
|
|
|
|
private c() {
|
|
}
|
|
|
|
public final a a(Member member) {
|
|
s.e(member, "member");
|
|
Class<?> cls = member.getClass();
|
|
try {
|
|
return new a(cls.getMethod("getParameters", new Class[0]), d.e(cls).loadClass("java.lang.reflect.Parameter").getMethod("getName", new Class[0]));
|
|
} catch (NoSuchMethodException unused) {
|
|
return new a(null, null);
|
|
}
|
|
}
|
|
|
|
public final a b() {
|
|
return f21903b;
|
|
}
|
|
|
|
public final List<String> c(Member member) {
|
|
Method a10;
|
|
s.e(member, "member");
|
|
a aVar = f21903b;
|
|
if (aVar == null) {
|
|
synchronized (this) {
|
|
c cVar = f21902a;
|
|
aVar = cVar.b();
|
|
if (aVar == null) {
|
|
aVar = cVar.a(member);
|
|
cVar.d(aVar);
|
|
}
|
|
}
|
|
}
|
|
Method b10 = aVar.b();
|
|
if (b10 == null || (a10 = aVar.a()) == null) {
|
|
return null;
|
|
}
|
|
Object invoke = b10.invoke(member, new Object[0]);
|
|
Objects.requireNonNull(invoke, "null cannot be cast to non-null type kotlin.Array<*>");
|
|
Object[] objArr = (Object[]) invoke;
|
|
ArrayList arrayList = new ArrayList(objArr.length);
|
|
int length = objArr.length;
|
|
int i10 = 0;
|
|
while (i10 < length) {
|
|
Object obj = objArr[i10];
|
|
i10++;
|
|
Object invoke2 = a10.invoke(obj, new Object[0]);
|
|
Objects.requireNonNull(invoke2, "null cannot be cast to non-null type kotlin.String");
|
|
arrayList.add((String) invoke2);
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public final void d(a aVar) {
|
|
f21903b = aVar;
|
|
}
|
|
}
|