Use AnnotationAccessor

This commit is contained in:
Frank van der Heijden 2021-09-19 13:51:20 +02:00 committed by Jason
parent 730e78e212
commit 7a5efbd6da

View file

@ -406,7 +406,8 @@ public final class AnnotationParser<C> {
final @NonNull Object instance,
final @NonNull Collection<@NonNull CommandMethodPair> methodPairs
) {
final CommandMethod classCommandMethod = instance.getClass().getAnnotation(CommandMethod.class);
final AnnotationAccessor classAnnotations = AnnotationAccessor.of(instance.getClass());
final CommandMethod classCommandMethod = classAnnotations.annotation(CommandMethod.class);
final String syntaxPrefix = classCommandMethod == null ? "" : (classCommandMethod.value() + " ");
final Collection<Command<C>> commands = new ArrayList<>();
for (final CommandMethodPair commandMethodPair : methodPairs) {