Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TokenBuffer._copyBufferValue floating point values #2982

Conversation

carterkozak
Copy link
Contributor

regressed handling inside polymorphic types. The TokenBuffer could
hold values as BigDecimal objects which are heavy on heap, but
critically also cannot be used to deserialize to a less precise
target, e.g. double. This is the inverse problem of #2644 where
not enough precision was retained, and reintroduces precision loss
while buffering floating point contents.

Alternative to #2978 however due to the way floating point values work, implicit coercion from BigDecimal to double should still be supported as proposed in the other PR.

The issue appears to be that we've attempted to map encoded floating point numbers into java types, which aren't an exact match. Perhaps the TokenBuffer should support an alternative encoding which preserves the raw input value? This would be difficult and implementation-specific, for example cbor floating point values wouldn't be stored in a char buffer, but json might.

regressed handling inside polymorphic types. The TokenBuffer could
hold values as BigDecimal objects which are heavy on heap, but
critically also cannot be used to deserialize to a less precise
target, e.g. double. This is the inverse problem of FasterXML#2644 where
not enough precision was retained, and reintroduces precision loss
while buffering floating point contents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants