-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Currently numeric strings are parsed in an awkward multi-stage fashion by JsonReader -- if there's a decimal point it tries to parse as double, if not then it tries int, if that didn't work then try long, etc. Once that's done, the resulting number is then converted to the target type later in the reading process. This can introduce errors when numbers are out of range (for example there was a long-standing bug where you could not import an unsigned long greater than the maximum -signed- long.)
Ideally numeric strings would only be parsed once we know the numeric type being read, rather than trying to guess from the type from the string format. Not only would this simplify the parsing, it would cut down on the plethora of importers needed for converting between different numeric types.