File tree Expand file tree Collapse file tree
main/java/org/scijava/ops
test/java/org/scijava/param Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -414,6 +414,10 @@ public static String opString(final OpInfo info) {
414414 sb .append (arg .getType ().getTypeName ());
415415 sb .append (" " );
416416 sb .append (arg .getKey ());
417+ if (!arg .getDescription ().isEmpty ()) {
418+ sb .append (" -> " );
419+ sb .append (arg .getDescription ());
420+ }
417421 sb .append ("\n " );
418422 }
419423 sb .append ("\t Outputs:\n " );
@@ -422,6 +426,10 @@ public static String opString(final OpInfo info) {
422426 sb .append (arg .getType ().getTypeName ());
423427 sb .append (" " );
424428 sb .append (arg .getKey ());
429+ if (!arg .getDescription ().isEmpty ()) {
430+ sb .append (" -> " );
431+ sb .append (arg .getDescription ());
432+ }
425433 sb .append ("\n " );
426434 sb .append (")\n " );
427435 return sb .toString ();
Original file line number Diff line number Diff line change @@ -140,6 +140,26 @@ public void testJavadocClass() {
140140 Assert .assertEquals ("the output" , outputDescription );
141141 }
142142
143+ @ Test
144+ public void opStringRegressionTest () {
145+ Iterator <OpInfo > infos = ops .env ().infos ("test.javadoc.method" ).iterator ();
146+
147+ OpInfo info = infos .next ();
148+ if (infos .hasNext ()) {
149+ Assert .fail ("Multiple OpInfos with name \" test.javadoc.method\" " );
150+ }
151+ String expected =
152+ "public static java.util.List<java.lang.Long> org.scijava.param.JavadocParameterTest." +
153+ "OpMethodFoo(java.util.List<java.lang.String>,java.util.List<java.lang.String>)(\n " +
154+ " Inputs:\n " +
155+ " java.util.List<java.lang.String> foo -> the first input\n " +
156+ " java.util.List<java.lang.String> bar -> the second input\n " +
157+ " Outputs:\n " +
158+ " java.util.List<java.lang.Long> output1 -> foo + bar\n " + ")\n " ;
159+ String actual = info .toString ();
160+ Assert .assertEquals (expected , actual );
161+
162+ }
143163}
144164
145165/**
You can’t perform that action at this time.
0 commit comments