Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix bug of ignoring the step size of a parameter
The step size attribute of a parameter is always ignored because there
is no converter that converts String to Number. The bug is fixed by
parsing the String to double. Similar bug exists in the script editor
and has been fixed.

See also:
c0ffe39
#205
  • Loading branch information
LeonYang5114 committed Nov 25, 2015
commit eca2a95b3f6de1c22aaafecb324c39346334ce9f
9 changes: 8 additions & 1 deletion src/main/java/org/scijava/command/CommandModuleItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ public T getMaximumValue() {

@Override
public Number getStepSize() {
return tValue(getParameter().stepSize(), Number.class);
final String value = getParameter().stepSize();
try {
final double stepSize = Double.parseDouble(value);
return stepSize;
}
catch (final NumberFormatException exc) {
return tValue(value, Number.class);
}
}

@Override
Expand Down