File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
scijava-ops-ext-parser/src
main/java/org/scijava/ops/parser
java/org/scijava/ops/parser Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,16 @@ public static String parseOpDocument(String inputYamlPath)
152152 final double priority = Double .parseDouble ((String ) opMetadata
153153 .getOrDefault (PRIORITY_KEY , "0.0" ));
154154
155- opNames .add ((String ) opMetadata .getOrDefault (ALIAS_KEY , "ext" +
156- methodName ));
155+ if (opMetadata .containsKey (ALIAS_KEY )) {
156+ Object alias = opMetadata .get (ALIAS_KEY );
157+ if (alias instanceof String ) {
158+ opNames .add ((String )alias );
159+ } else if (alias instanceof List ) {
160+ opNames .addAll ((List <String >)alias );
161+ }
162+ } else {
163+ opNames .add ("ext." + methodName );
164+ }
157165
158166 List <String > opAuthors = authors ;
159167 if (opMetadata .containsKey (AUTHOR_KEY )) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public void validateParsing() throws ClassNotFoundException {
4949
5050 String expected = //
5151 "- op:" //
52- + "\n names: [arrays.toStringDeep, test.deepToString]" //
52+ + "\n names: [arrays.toStringDeep, fun.stringMaker, test.deepToString]" //
5353 + "\n description: ''" //
5454 +
5555 "\n source: javaMethod:/java.util.Arrays.deepToString%28%5BLjava.lang.Object%3B%29" //
@@ -61,7 +61,7 @@ public void validateParsing() throws ClassNotFoundException {
6161 + "\n authors: [Nobody, Everybody]" //
6262 + "\n tags: {}" //
6363 + "\n - op:" //
64- + "\n names: [system .arraycopy, test.arraycopy]" //
64+ + "\n names: [ext .arraycopy, test.arraycopy]" //
6565 + "\n description: a useful op" //
6666 +
6767 "\n source: javaMethod:/java.lang.System.arraycopy%28java.lang.Object%2Cint%2Cjava.lang.Object%2Cint%2Cint%29" //
Original file line number Diff line number Diff line change @@ -6,11 +6,12 @@ authors:
66
77java.util.Arrays :
88 deepToString :
9- alias : " arrays.toStringDeep"
9+ alias :
10+ - " arrays.toStringDeep"
11+ - " fun.stringMaker"
1012
1113java.lang.System :
1214 arraycopy :
13- alias : " system.arraycopy"
1415 priority : " 50"
1516 description : " a useful op"
1617 authors :
You can’t perform that action at this time.
0 commit comments