From aefd8a51a084fd937eee881a9dca69eb3aec5ef6 Mon Sep 17 00:00:00 2001 From: tueem Date: Mon, 2 Dec 2024 21:19:42 +0100 Subject: [PATCH] change wrong annotation class usage --- .../java/net/tomatentum/marinara/checks/AppliedCheck.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/main/java/net/tomatentum/marinara/checks/AppliedCheck.java b/lib/src/main/java/net/tomatentum/marinara/checks/AppliedCheck.java index 44e4c8a..0383ac6 100644 --- a/lib/src/main/java/net/tomatentum/marinara/checks/AppliedCheck.java +++ b/lib/src/main/java/net/tomatentum/marinara/checks/AppliedCheck.java @@ -14,7 +14,7 @@ public record AppliedCheck(InteractionCheck check, Annotation annotation) { .filter(x -> x.getName().equals("preExec")) .filter(x -> !x.isBridge()) .toArray(s -> new Method[s]); - Method method = ReflectionUtil.getMostSpecificMethod(methods, context.getClass(), annotation.getClass()); + Method method = ReflectionUtil.getMostSpecificMethod(methods, context.getClass(), annotation.annotationType()); method.setAccessible(true); try { return (boolean) method.invoke(check, context, annotation); @@ -29,7 +29,7 @@ public record AppliedCheck(InteractionCheck check, Annotation annotation) { .filter(x -> x.getName().equals("postExec")) .filter(x -> !x.isBridge()) .toArray(s -> new Method[s]); - Method method = ReflectionUtil.getMostSpecificMethod(methods, context.getClass(), annotation.getClass()); + Method method = ReflectionUtil.getMostSpecificMethod(methods, context.getClass(), annotation.annotationType()); method.setAccessible(true); try { method.invoke(check, context, annotation);