2022-03-02 20:59:20 +00:00
|
|
|
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;
|
2022-03-22 15:40:06 +00:00
|
|
|
/* loaded from: com.discord-119010.apk:lombok/core/AgentLauncher.SCL.lombok */
|
2022-03-02 20:59:20 +00:00
|
|
|
public class AgentLauncher {
|
|
|
|
private static final List<AgentInfo> AGENTS = Collections.unmodifiableList(Arrays.asList(new EclipsePatcherInfo(null)));
|
|
|
|
|
2022-03-22 15:40:06 +00:00
|
|
|
/* loaded from: com.discord-119010.apk:lombok/core/AgentLauncher$AgentInfo.SCL.lombok */
|
2022-03-02 20:59:20 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-22 15:40:06 +00:00
|
|
|
/* loaded from: com.discord-119010.apk:lombok/core/AgentLauncher$AgentLaunchable.SCL.lombok */
|
2022-03-02 20:59:20 +00:00
|
|
|
public interface AgentLaunchable {
|
|
|
|
void runAgent(String str, Instrumentation instrumentation, boolean z2, Class<?> cls) throws Exception;
|
|
|
|
}
|
|
|
|
|
2022-03-22 15:40:06 +00:00
|
|
|
/* loaded from: com.discord-119010.apk:lombok/core/AgentLauncher$EclipsePatcherInfo.SCL.lombok */
|
2022-03-02 20:59:20 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|