Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
(Java) V4 4.8.0, (Java) V4 4.9.0
-
None
Description
This is a refiling OLINGO-1549 except categorized as a bug.
This bug was introduced with the change made in OLINGO-1480 to allow for larger precision/scale values when passed in as a BigDecimal as they can exceed the default precision of 40 and scale of 25.
However, this broke insertions for values ranging from ]0.0, 0.1[ as their BigDecimal representations have precision less than scale (which is not allowed according to the OData CSDL).
This also breaks insertions for BigDecimal values that do not specify precision - an arbitrary precision in BigDecimal is represented as 0 versus the arbitrary precision representation of null in OData.
The following throws an exception due to this bug
new ClientObjectFactoryImpl().newPrimitiveValueBuilder().buildDecimal(new BigDecimal("0.04")).toString();
java.lang.IllegalArgumentException: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value '0.04' does not match the facets' constraints.
Attachments
Attachments
Issue Links
- relates to
-
OLINGO-1549 cannot create amount smaller than 0.10
- Open