jackson-core icon indicating copy to clipboard operation
jackson-core copied to clipboard

Optional leading plus sign not included in textual value of any integral nor all floating-point numbers

Open cowtowncoder opened this issue 2 years ago • 2 comments

Implementation of #774 is mostly complete, but there is one minor inconsistency: whereas leading plus sign -- if (and only if) enabled as non-standard feature -- is retained for some floating-point numbers when accessing token with JsonParser.getText() (and related), it is not retained for any of integral numbers (nor all FPs).

The underlying problem to solve is that of assumptions based on there only ever being a leading minus sign in TextBuffer (or shared input buffer): something that made sense before allowing non-standard leading plus.

cowtowncoder avatar Jun 28 '22 00:06 cowtowncoder

Come to think of this, I may want to remove leading plus sign from all cases, instead of trying to add it. While ideally it'd be included always, more important to me is the consistency of support.

cowtowncoder avatar Jun 28 '22 00:06 cowtowncoder

Ok, so: for now non-standard plus (+) is never included in text returned. This is different from other deviations, partly since they are omissions (lack of leading 0, or trailing digit after decimal comma). I guess comparison could be to leading zeroes, handling of which (in non-standard) mode I don't actually know. But if they are not exposed we could even consider current behavior as the expected way (leave out non-standard characters). Have to think more about this -- then again it will take some effort to retain plus sign anyway so there is no urgency.

cowtowncoder avatar Jun 29 '22 22:06 cowtowncoder