Skip to content

Commit 5bd5a43

Browse files
committed
CommandRunner: do not add new command to the index
I may regret this later. But it is much simpler and easier to understand if we just run the command class directly, rather than wrapping it in a new CommandInfo and then adding it to the PluginIndex. If we later decide to restore the PluginIndex-modifying behavior, let's do it in a nicer way where we have a method in CommandService that does this work, rather than needing to recapitulate its internals here.
1 parent 0931e1c commit 5bd5a43

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/org/scijava/command/run/CommandRunner.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
package org.scijava.command.run;
3333

3434
import org.scijava.command.Command;
35-
import org.scijava.command.CommandInfo;
3635
import org.scijava.command.CommandService;
3736
import org.scijava.plugin.Parameter;
3837
import org.scijava.plugin.Plugin;
@@ -60,10 +59,7 @@ public class CommandRunner extends AbstractClassRunner {
6059
public void run(final Class<?> c, final Object... args) {
6160
@SuppressWarnings("unchecked")
6261
final Class<? extends Command> commandClass = (Class<? extends Command>) c;
63-
final Plugin annotation = c.getAnnotation(Plugin.class);
64-
final CommandInfo info = new CommandInfo(commandClass, annotation);
65-
pluginService.addPlugin(info);
66-
commandService.run(info, true, args);
62+
commandService.run(commandClass, true, args);
6763
}
6864

6965
// -- Typed methods --

0 commit comments

Comments
 (0)