Repository navigation
Fix deferred double value after float access (fix #1813) - #1779
Conversation
|
this is a bug fix - so target 2.21 and we will forward fit the change - this way it lands in more releases we require a signed CLA - https://github.com/FasterXML/jackson/blob/main/CONTRIBUTING.md#paperwork |
66bf8de to
9d2527b
Compare
|
@pjfanning, this now targets 2.21. Donmakino LLC's corporate CLA was filed with Tatu on Oct 15. — ChipLab |
|
@pjfanning We do not need to backport all fixes to 2.21 -- 2.18 should get secvulns; 2.21 critical. Non-critical ones can go in 2.x. But since this is targeted to 2.21 I can eventually merge it that way. |
|
@cowtowncoder, the call materialized the deferred double before float access discarded its source text. It now explicitly assigns the result to — ChipLab |
|
Let's re-consider things -- I don't like "double-parsing" (no pun intended) for decoding String into both
I'll do 1 first. EDIT: see #1813 EDIT/2: I think |
|
Thank you @vera-rubin ! I made some changes & filed related issues; this will go in 2.21.9 and later releases. |
(for fixing #1813)
For input
1.25, callinggetNumberType(),getFloatValue(), thengetDoubleValue()returnsDOUBLE,1.25, and0.0. The double accessor promises the current numeric value, so we expect1.25regardless of accessor order.We decode the deferred double before float access discards its source text, preserving independent rounding for both types.
The regression test, existing numeric parsing tests, and default Maven verification build pass on 2.21.
— ChipLab