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

CLICommandInvoker was being too strict about how a CLICommand was registered #296

Merged
merged 2 commits into from
Apr 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/main/java/hudson/cli/CLICommandInvoker.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

package hudson.cli;

import hudson.Extension;
import hudson.ExtensionList;
import hudson.model.User;
import hudson.security.ACL;
import hudson.security.AuthorizationStrategy;
Expand Down Expand Up @@ -78,13 +78,7 @@ public class CLICommandInvoker {

public CLICommandInvoker(final JenkinsRule rule, final CLICommand command) {

if (command.getClass().getAnnotation(Extension.class) == null) {

throw new AssertionError(String.format(
"Command %s is missing @Extension annotation.",
command.getClass()
));
}
ExtensionList.lookupSingleton(command.getClass()); // verify that it was registered e.g. with @Extension

this.rule = rule;
this.command = command;
Expand Down