add Checks system #6

Merged
tueem merged 16 commits from feat/checks into dev 2024-12-05 07:51:37 +00:00
Showing only changes of commit aefd8a51a0 - Show all commits

View File

@ -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);