mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Skip over method name in args loop, start at i=1
This commit is contained in:
parent
c71ad8489c
commit
723fc8fc08
1 changed files with 2 additions and 6 deletions
|
@ -35,14 +35,10 @@ class NegativeNumberOptions {
|
||||||
String[] removeNegativeNumberOptions(String[] args) {
|
String[] removeNegativeNumberOptions(String[] args) {
|
||||||
// Cache any negative number params that will be rejected by the parser.
|
// Cache any negative number params that will be rejected by the parser.
|
||||||
// This should be called before command line parsing.
|
// This should be called before command line parsing.
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (int i = 1; i < args.length; i++) {
|
||||||
|
// Start at i=1; args[0] is the method name.
|
||||||
if (isNegativeNumber.test(args[i])) {
|
if (isNegativeNumber.test(args[i])) {
|
||||||
String param = args[i];
|
String param = args[i];
|
||||||
// Copy the negative number found in args[i] to map(i-1) because
|
|
||||||
// args contains the method name, but the cloned map only contains
|
|
||||||
// the method's arguments:
|
|
||||||
// args[0] = api method name
|
|
||||||
// negativeNumberParams.get(0) = 1st parameter of api method
|
|
||||||
negativeNumberParams.put(i - 1, new BigDecimal(param).toString());
|
negativeNumberParams.put(i - 1, new BigDecimal(param).toString());
|
||||||
// Substitute a zero placeholder at the index containing the
|
// Substitute a zero placeholder at the index containing the
|
||||||
// negative number option value.
|
// negative number option value.
|
||||||
|
|
Loading…
Add table
Reference in a new issue