FasterXML/jackson-databind — pull request #162 by fge (2013-02-08 13:29:36+00:00)
Title: JsonNodeFactory: work around an old bug with BigDecimal and zero

This is the bug in question:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539

In short: BigDecimal's .stripTrainlingZeroes() does not work at all on decimals
which value is _exactly_ 0:

* new BigDecimal("0.0100").stripTrailingZeroes() has a scale of 2, as expected;
* new BigDecimal("0") has a scale of 0;
* new BigDecimal("0.000").stripTrailingZeroes() has a scale of... 3!

To work around this bug, when the user asks to create a decimal node, compare
the given value with BigDecimal.ZERO, and if the result is 0, return
DecimalNode.ZERO (newly created by this patch), which is a "new
DecimalNode(BigDecimal.ZERO)".