Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CommandMethod applicable to class #301

Merged
merged 2 commits into from
Sep 19, 2021
Merged

Make CommandMethod applicable to class #301

merged 2 commits into from
Sep 19, 2021

Conversation

FrankHeijden
Copy link
Contributor

Isse nice for not having to repeat the base command :)

@@ -406,13 +406,16 @@ public void registerCommandExecutionMethodFactory(
final @NonNull Object instance,
final @NonNull Collection<@NonNull CommandMethodPair> methodPairs
) {
final CommandMethod classCommandMethod = instance.getClass().getAnnotation(CommandMethod.class);
Copy link
Member

@Citymonstret Citymonstret Sep 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might seem random, but could you do this:

final AnnotationAccessor classAnnotations = AnntationAccessor.of(instance.getClass());
final CommandMethod classCommandMethod = classAnnotations.get(CommandMethod.class);

?

It'd be nice to be consistent about where we retrieve annotations from

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@Citymonstret Citymonstret merged commit 50b38d2 into Incendo:1.6.0-dev Sep 19, 2021
@zml2008 zml2008 added this to the 1.6.0 milestone Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants