Daniel Fernández created OLINGO-1642:
----------------------------------------
Summary: EdmDecimal#internalValueToString fails for decimal values
with only 0s for the decimal digits
Key: OLINGO-1642
URL: https://issues.apache.org/jira/browse/OLINGO-1642
Project: Olingo
Issue Type: Bug
Components: odata4-client
Affects Versions: (Java) V4 4.10.0
Reporter: Daniel Fernández
When consuming EdmDecimal values like {{418082410.0000000000}} (BigDecimal
{{{}4.1808241E+8{}}}), this condition in
{{org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal#internalValueToString()}}
fails:
{{((precision == null || precision >= digits) && (bigDecimalValue.scale() <=
(scale == null ? 0 : scale)))}}
For this example:
* precision = 8
* digits = 9
* scale = -1
So {{precision >= digits}} is always false for this decimal values and the
method always rises the exception:
{{throw new EdmPrimitiveTypeException("The value '" + value + "' does not match
the facets' constraints.");}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)