Skip to content

Fixes a bug in the incremental reader that caused certain Decimal, BigDecimal, and BigInteger values to be read incorrectly in multi-reader contexts.#436

Merged
tgregg merged 1 commit intomasterfrom
static-fix
Aug 17, 2022
Merged

Fixes a bug in the incremental reader that caused certain Decimal, BigDecimal, and BigInteger values to be read incorrectly in multi-reader contexts.#436
tgregg merged 1 commit intomasterfrom
static-fix

Conversation

@tgregg
Copy link
Copy Markdown
Contributor

@tgregg tgregg commented Aug 17, 2022

Description of changes:

The incremental reader's implementation of decimalValue, bigDecimalValue, and bigIntegerValue use scratch space (example). decimalValue and bigIntegerValue use this scratch space for all values, while bigDecimalValue only use it for values with coefficients that consume at least 8 bytes.

The scratch space is incorrectly declared static, which causes the same space to be used by multiple readers when they are accessed concurrently.

The fix for the bug is simply to make the scratch space non-static; the fact that it is static at all appears to have been a simple mistake and is not an essential aspect of the design.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…gDecimal, and BigInteger values to be read incorrectly in multi-reader contexts.
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 17, 2022

Codecov Report

Merging #436 (089d460) into master (53394b6) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #436      +/-   ##
============================================
- Coverage     66.57%   66.56%   -0.01%     
+ Complexity     5415     5414       -1     
============================================
  Files           156      156              
  Lines         22762    22762              
  Branches       4105     4105              
============================================
- Hits          15153    15151       -2     
- Misses         6246     6247       +1     
- Partials       1363     1364       +1     
Impacted Files Coverage Δ
...om/amazon/ion/impl/IonReaderBinaryIncremental.java 95.80% <100.00%> (ø)
src/com/amazon/ion/impl/BlockedBuffer.java 51.33% <0.00%> (-0.25%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tgregg tgregg merged commit e90a636 into master Aug 17, 2022
@tgregg tgregg deleted the static-fix branch August 17, 2022 04:29
tgregg added a commit that referenced this pull request Sep 26, 2022
tgregg added a commit that referenced this pull request Oct 10, 2023
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.

2 participants