13
0
geforkt von Mirrors/Velocity

Get rid of the Guava Subscribe annotation check

I think we can trust that if you're working with Velocity, you can find
the right Velocity subscribe annotation.
Dieser Commit ist enthalten in:
Andrew Steinborn 2019-05-14 04:18:18 -04:00
Ursprung fc9e2d576d
Commit d7136150fd

Datei anzeigen

@ -15,7 +15,6 @@ import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.Objects;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@ -30,7 +29,6 @@ import net.kyori.event.method.asm.ASMEventExecutorFactory;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
public class VelocityEventManager implements EventManager { public class VelocityEventManager implements EventManager {
@ -87,14 +85,6 @@ public class VelocityEventManager implements EventManager {
throw new IllegalArgumentException("The plugin main instance is automatically registered."); throw new IllegalArgumentException("The plugin main instance is automatically registered.");
} }
for (Method method : listener.getClass().getDeclaredMethods()) {
if (method.isAnnotationPresent(com.google.common.eventbus.Subscribe.class)) {
throw new IllegalArgumentException("Method " + listener.getClass().getName() + "#"
+ method.getName() + " has a Guava @Subscribe annotation. Use the Velocity @Subscribe "
+ "annotation instead.");
}
}
registeredListenersByPlugin.put(plugin, listener); registeredListenersByPlugin.put(plugin, listener);
methodAdapter.register(listener); methodAdapter.register(listener);
} }