Skip to content

Commit

Permalink
ui: load persisted Integer synthesis options as such.
Browse files Browse the repository at this point in the history
Closes #23.
  • Loading branch information
NiklasRentzCAU committed Jul 28, 2021
1 parent a029454 commit 4e48e13
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public static Object parse(final SynthesisOption option, final String value) {
if (option.isCheckOption()) {
return Boolean.parseBoolean(value);
} else if (option.isRangeOption()) {
// An Integer range option should be parsed as an integer. Default to float parsing otherwise.
if (option.getRange().getFirst() instanceof Integer
&& option.getRange().getSecond() instanceof Integer
&& option.getStepSize() instanceof Integer) {
return Integer.parseInt(value);
}
return Float.parseFloat(value);
} else if (option.isChoiceOption()) {
int hash = Integer.parseInt(value);
Expand Down

0 comments on commit 4e48e13

Please sign in to comment.