From e84958309bbcfc8ff7a21da413615610c2a59f0d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 23 Aug 2022 13:00:46 +0200 Subject: [PATCH] Fix generic type search --- .../src/com/comphenix/tinyprotocol/Reflection.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SpigotCore_Main/src/com/comphenix/tinyprotocol/Reflection.java b/SpigotCore_Main/src/com/comphenix/tinyprotocol/Reflection.java index 10d9155..7348bcf 100644 --- a/SpigotCore_Main/src/com/comphenix/tinyprotocol/Reflection.java +++ b/SpigotCore_Main/src/com/comphenix/tinyprotocol/Reflection.java @@ -4,10 +4,7 @@ import de.steamwar.core.Core; import jdk.internal.misc.Unsafe; import org.bukkit.Bukkit; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; +import java.lang.reflect.*; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -189,7 +186,7 @@ public final class Reflection { return false; if(parameters.length > 0) { - Class[] arguments = (Class[]) ((ParameterizedType)field.getGenericType()).getActualTypeArguments(); + Type[] arguments = ((ParameterizedType)field.getGenericType()).getActualTypeArguments(); for(int i = 0; i < parameters.length; i++) { if(arguments[i] != parameters[i])