From 3d3d6adf0409713a1d3d9f3bba6016995dbf6144 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 3 Dec 2018 23:55:39 +0000 Subject: [PATCH] Remove redundant null check in VelocityMethodScanner --- .../velocitypowered/proxy/plugin/VelocityEventManager.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java index b0ec5cfdd..7526a50a2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java @@ -173,12 +173,7 @@ public class VelocityEventManager implements EventManager { @Override public int postOrder(@NonNull Object listener, @NonNull Method method) { - Subscribe annotation = method.getAnnotation(Subscribe.class); - if (annotation == null) { - throw new IllegalStateException( - "Trying to determine post order for listener without @Subscribe annotation"); - } - return annotation.order().ordinal(); + return method.getAnnotation(Subscribe.class).order().ordinal(); } @Override