Skip to content

Commit 27fb650

Browse files
committed
CommandInfo: remove now-superfluous code
The PluginInfo base class now implements the Locatable#getLocation() and Versioned#getVersion() methods in the identical way, so CommandInfo no longer needs to implement them itself. Note that it _does_ still need to implement the Identifiable#getIdentifier() method, because the identifier of commands is different than that of plugins in general.
1 parent 90a744b commit 27fb650

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

src/main/java/org/scijava/command/CommandInfo.java

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@
4242

4343
import org.scijava.Cancelable;
4444
import org.scijava.Context;
45-
import org.scijava.Identifiable;
4645
import org.scijava.InstantiableException;
4746
import org.scijava.ItemVisibility;
48-
import org.scijava.Locatable;
4947
import org.scijava.ValidityProblem;
50-
import org.scijava.Versioned;
5148
import org.scijava.event.EventService;
5249
import org.scijava.module.Module;
5350
import org.scijava.module.ModuleException;
@@ -60,7 +57,6 @@
6057
import org.scijava.service.Service;
6158
import org.scijava.util.ClassUtils;
6259
import org.scijava.util.StringMaker;
63-
import org.scijava.util.VersionUtils;
6460

6561
/**
6662
* A collection of metadata about a particular {@link Command}.
@@ -78,9 +74,7 @@
7874
* @see CommandModule - An adapter class that bridges the gap between ImageJ
7975
* commands and the rich {@link Module} interface.
8076
*/
81-
public class CommandInfo extends PluginInfo<Command> implements ModuleInfo,
82-
Identifiable, Locatable, Versioned
83-
{
77+
public class CommandInfo extends PluginInfo<Command> implements ModuleInfo {
8478

8579
/** Wrapped {@link PluginInfo}, if any. */
8680
private final PluginInfo<Command> info;
@@ -425,30 +419,6 @@ public String getIdentifier() {
425419
return sb.toString();
426420
}
427421

428-
// -- Locatable methods --
429-
430-
@Override
431-
public String getLocation() {
432-
try {
433-
return ClassUtils.getLocation(loadDelegateClass()).toExternalForm();
434-
}
435-
catch (final ClassNotFoundException exc) {
436-
return null;
437-
}
438-
}
439-
440-
// -- Versioned methods --
441-
442-
@Override
443-
public String getVersion() {
444-
try {
445-
return VersionUtils.getVersion(loadDelegateClass());
446-
}
447-
catch (final ClassNotFoundException exc) {
448-
return null;
449-
}
450-
}
451-
452422
// -- Helper methods --
453423

454424
/**

0 commit comments

Comments
 (0)