The GitHub Actions job "CodeQL" on 
poi-xmlbeans.git/patches/printdecimal-wider-than-long has failed.
Run started by GitHub user czpilar (triggered by czpilar).

Head commit for run:
976aec59bac79fb46be963091b356367b9d4f9a4 / David Pilar <[email protected]>
Fix printDecimal regression for decimal values wider than a long

Regression introduced in 5.4.0: printing an xsd:decimal that does not fit into a
long throws IllegalArgumentException("Value can't be converted to long"). 5.3.0
prints the same value correctly.

XsTypeConverter.printDecimal used MathUtil.toLong(value) == 0 to test whether 
the
value is zero. toLong() throws for anything wider than a long, so the check blew
up on values it was only ever meant to classify. 5.3.0 used 
BigDecimal.longValue()
here, which truncates silently; MathUtil was added in 5.4.0 and toLong() 
replaced
longValue() on this line.

Use signum() instead, as in the original Harmony code this method is derived 
from:
same semantics, cannot throw, O(1), and it keeps MathUtil off the serialization
path entirely.

Seen in the wild as a WSDL2Java code generation failure: xmlbeans could no 
longer
save a compiled schema type system containing a high-precision decimal.

Report URL: https://github.com/apache/poi-xmlbeans/actions/runs/33020046840

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to