File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
main/java/org/scijava/command
test/java/org/scijava/command Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,14 @@ public T getMaximumValue() {
145145
146146 @ Override
147147 public Number getStepSize () {
148- return tValue (getParameter ().stepSize (), Number .class );
148+ final String value = getParameter ().stepSize ();
149+ try {
150+ final double stepSize = Double .parseDouble (value );
151+ return stepSize ;
152+ }
153+ catch (final NumberFormatException exc ) {
154+ return tValue (value , Number .class );
155+ }
149156 }
150157
151158 @ Override
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ public void testValid() {
7171 final List <ValidityProblem > problems = info .getProblems ();
7272 assertNotNull (problems );
7373 assertEquals (0 , problems .size ());
74+
75+ final Number stepSize = info .getInput ("x" ).getStepSize ();
76+ assertNotNull (stepSize );
77+ assertEquals (10 , stepSize .intValue ());
7478 }
7579
7680 @ Test
@@ -101,7 +105,7 @@ public void testInvalid() {
101105 @ Plugin (type = Command .class )
102106 public static class ValidCommand implements Command {
103107
104- @ Parameter
108+ @ Parameter ( stepSize = "10" )
105109 private double x ;
106110
107111 @ Parameter (type = ItemIO .OUTPUT )
You can’t perform that action at this time.
0 commit comments