You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently:
Byte, short, int and long conversion (for both primitives and wrappers) uses the decode method, so numbers starting with 0x, 0X or # are interpreted as hexadecimal numbers, numbers starting with 0 are interpreted as octal numbers, and otherwise the number is interpreted as a decimal number.
Unless otherwise specified, whenever an operand or option-argument is, or contains, a numeric value:
The number is interpreted as a decimal integer.
Perhaps using the decode method by default is not a good idea.
Let's revert to the parse methods that interpret as a decimal value, and in the documentation suggest that applications that want to support hex values register the decode method:
commandLine.registerConverter(Integer.class, s -> Integer::decode);
The text was updated successfully, but these errors were encountered:
Currently:
Byte, short, int and long conversion (for both primitives and wrappers) uses the decode method, so numbers starting with 0x, 0X or # are interpreted as hexadecimal numbers, numbers starting with 0 are interpreted as octal numbers, and otherwise the number is interpreted as a decimal number.
But see POSIX Utility Conventions Requirement 6:
Perhaps using the
decode
method by default is not a good idea.Let's revert to the parse methods that interpret as a decimal value, and in the documentation suggest that applications that want to support hex values register the decode method:
commandLine.registerConverter(Integer.class, s -> Integer::decode);
The text was updated successfully, but these errors were encountered: