Fix checkstyle violation

This commit is contained in:
Jason Penilla 2021-06-11 03:29:44 -07:00 committed by Jason
parent d831cf82de
commit 4312062e82

View file

@ -49,6 +49,7 @@ package cloud.commandframework.bukkit.internal;
import com.mojang.brigadier.arguments.ArgumentType;
import org.bukkit.NamespacedKey;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
@ -109,7 +110,7 @@ public final class MinecraftArgumentTypes {
* @throws IllegalArgumentException if no such argument is registered
*/
@SuppressWarnings("unchecked")
public static Class<? extends ArgumentType<?>> getClassByKey(NamespacedKey key) throws IllegalArgumentException {
public static Class<? extends ArgumentType<?>> getClassByKey(final @NonNull NamespacedKey key) throws IllegalArgumentException {
try {
Object minecraftKey = MINECRAFT_KEY_CONSTRUCTOR.newInstance(key.getNamespace(), key.getKey());
Object entry = ARGUMENT_REGISTRY_GET_BY_KEY_METHOD.invoke(null, minecraftKey);