Skip to content

Commit

Permalink
Merge pull request #296 from jglick/CLICommandInvoker
Browse files Browse the repository at this point in the history
CLICommandInvoker was being too strict about how a CLICommand was registered
  • Loading branch information
jglick authored Apr 19, 2021
2 parents 2344300 + 98ff4c8 commit 7adf295
Showing 1 changed file with 2 additions and 8 deletions.
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

0 comments on commit 7adf295

Please sign in to comment.