discord-jadx/app/src/main/java/lombok/core/AgentLauncher.java

76 lines
3.0 KiB
Java

package lombok.core;
import java.lang.instrument.Instrumentation;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/* loaded from: com.discord-117113.apk:lombok/core/AgentLauncher.SCL.lombok */
public class AgentLauncher {
private static final List<AgentInfo> AGENTS = Collections.unmodifiableList(Arrays.asList(new EclipsePatcherInfo(null)));
/* loaded from: com.discord-117113.apk:lombok/core/AgentLauncher$AgentInfo.SCL.lombok */
private static abstract class AgentInfo {
private AgentInfo() {
}
abstract String className();
void problem(Throwable th, Instrumentation instrumentation) throws Throwable {
if (!(th instanceof ClassNotFoundException)) {
if (th instanceof ClassCastException) {
throw new InternalError("Lombok bug. Class: " + className() + " is not an implementation of lombok.core.Agent");
} else if (th instanceof IllegalAccessError) {
throw new InternalError("Lombok bug. Class: " + className() + " is not public");
} else if (th instanceof InstantiationException) {
throw new InternalError("Lombok bug. Class: " + className() + " is not concrete or has no public no-args constructor");
} else {
throw th;
}
}
}
/* synthetic */ AgentInfo(AgentInfo agentInfo) {
this();
}
}
/* loaded from: com.discord-117113.apk:lombok/core/AgentLauncher$AgentLaunchable.SCL.lombok */
public interface AgentLaunchable {
void runAgent(String str, Instrumentation instrumentation, boolean z2, Class<?> cls) throws Exception;
}
/* loaded from: com.discord-117113.apk:lombok/core/AgentLauncher$EclipsePatcherInfo.SCL.lombok */
private static class EclipsePatcherInfo extends AgentInfo {
private EclipsePatcherInfo() {
super(null);
}
@Override // lombok.core.AgentLauncher.AgentInfo
String className() {
return "lombok.eclipse.agent.EclipsePatcher";
}
/* synthetic */ EclipsePatcherInfo(EclipsePatcherInfo eclipsePatcherInfo) {
this();
}
}
public static void runAgents(String str, Instrumentation instrumentation, boolean z2, Class<?> cls) throws Throwable {
Iterator<AgentInfo> it = AGENTS.iterator();
while (it.hasNext()) {
AgentInfo next = it.next();
try {
((AgentLaunchable) Class.forName(next.className()).getConstructor(new Class[0]).newInstance(new Object[0])).runAgent(str, instrumentation, z2, cls);
} catch (Throwable th) {
th = th;
if (th instanceof InvocationTargetException) {
th = th.getCause();
}
next.problem(th, instrumentation);
}
}
}
}