GitHub user daradurvs opened a pull request:
https://github.com/apache/ignite/pull/1473
IGNITE-3196
We shouldn't check sign at serialization, because the used approach:
BigInteger intVal = val.unscaledValue();
byte[] vals = intVal.toByteArray();
#toByteArray() - already including at least one sign bit, which is
(ceil((this.bitLength() + 1)/8)). (This representation is compatible with the
(byte[]) constructor.)
Therefore, at deserialization we just read byte[] vals and scale, also we
use default constructor which will define a sign from byte[] vals.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/daradurvs/ignite ignite-3196
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/1473.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1473
----
commit 48fab04f4a8b48a1f6ff0a632d56075c855b62e5
Author: daradurvs <[email protected]>
Date: 2017-01-26T17:21:01Z
ignite-3196: serialization of BigDecimal is simplified
commit 91327c3797fb1ea8702cf8e2ce34998819c0c8c9
Author: daradurvs <[email protected]>
Date: 2017-01-27T09:50:32Z
ignite-3196: fix old serialization method (it is better, serialized object
has the smaller size)
commit f3d2297d9db4e773003eeea800ae37843ce79f14
Author: daradurvs <[email protected]>
Date: 2017-01-27T11:48:53Z
ignite-3196: "negative scale with RoundingMode" tests are added
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---