scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

DynamicCommand doesn't extend CommandModule

Open imagejan opened this issue 5 years ago • 0 comments

The fact that DynamicCommand extends DefaultMutableModule but not CommandModule leads to CommandService.run() returning null, as explained in the [DEBUG] output here:

https://github.com/scijava/scijava-common/blob/80d0a38fc9e9c1d85c3a5602cddedf6cd10984a7/src/main/java/org/scijava/command/DefaultCommandService.java#L345-L363

So the workaround is to get the CommandInfo and call ModuleService#run() on it to get the Future<Module>... but is there any chance to make it extend CommandModule but still implement the required interface MutableModule without breaking backwards compatibility?

imagejan avatar Nov 17 '20 10:11 imagejan