Skip to content

Commit ed9f724

Browse files
committed
Gateway: default to plugin name for getShortName()
And name the SciJava gateway "sj" and stop overriding getShortName().
1 parent cbd0ec5 commit ed9f724

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/main/java/org/scijava/AbstractGateway.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ public void launch(final String... args) {
114114

115115
@Override
116116
public String getShortName() {
117+
final String pluginName = getInfo() == null ? null : getInfo().getName();
118+
if (pluginName != null && !pluginName.isEmpty()) return pluginName;
117119
return getClass().getSimpleName().toLowerCase();
118120
}
119121

src/main/java/org/scijava/SciJava.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* @author Curtis Rueden
4747
*/
48-
@Plugin(type = Gateway.class)
48+
@Plugin(type = Gateway.class, name = "sj")
4949
public class SciJava extends AbstractGateway {
5050

5151
// -- Constructors --
@@ -113,12 +113,4 @@ public SciJava(final Collection<Class<? extends Service>> serviceClasses) {
113113
public SciJava(final Context context) {
114114
super(SciJavaApp.NAME, context);
115115
}
116-
117-
// -- Gateway methods --
118-
119-
@Override
120-
public String getShortName() {
121-
return "sj";
122-
}
123-
124116
}

0 commit comments

Comments
 (0)