From 9bece076f5ffceebaa27e08b1f5e152a379a4091 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 11 Jun 2020 02:08:04 -0400 Subject: [PATCH] Remove old Checker Framework relics. Proper Checker Framework support needs to wait for a major Velocity version and almost necessities a total refactor, if not rewrite, of Velocity. --- .../velocitypowered/proxy/VelocityServer.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 036956882..21b08e3aa 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -120,12 +120,12 @@ public class VelocityServer implements ProxyServer { } public KeyPair getServerKeyPair() { - return ensureInitialized(serverKeyPair); + return serverKeyPair; } @Override public VelocityConfiguration getConfiguration() { - return ensureInitialized(this.configuration); + return this.configuration; } @Override @@ -229,7 +229,6 @@ public class VelocityServer implements ProxyServer { Metrics.VelocityMetrics.startMetrics(this, configuration.getMetrics()); } - @RequiresNonNull({"pluginManager", "eventManager"}) private void loadPlugins() { logger.info("Loading plugins..."); @@ -443,18 +442,11 @@ public class VelocityServer implements ProxyServer { } public AsyncHttpClient getAsyncHttpClient() { - return ensureInitialized(cm).getHttpClient(); + return cm.getHttpClient(); } public Ratelimiter getIpAttemptLimiter() { - return ensureInitialized(ipAttemptLimiter); - } - - private static T ensureInitialized(T o) { - if (o == null) { - throw new IllegalStateException("The proxy isn't fully initialized."); - } - return o; + return ipAttemptLimiter; } /**