BigDecimal Issue (Java1.6) For Scaled “0” Values. Ie. “0.0” With SetScale(8) Will “0E-8” (Doc ID 1487131.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Sun Schema Runtime Environment (SRE) - Version 5.0.5u2 and later
Information in this document applies to any platform.
Checked for relevance on 03-11-2014

Symptoms

After EGate SRE5.0.5 GA (java 1.4) to EGate SRE5.0.5 Update2 (java 1.6) migration, the BigDecimal.toString() now returns exponents for small numbers. The end system hence now receives for example “0-E8” in place of “0.00000000” and this results in schema validation errors. This issues is caused by the EGate framework when objects with BigDecimal variables will marshaled or serialized to i.e. XML.

Line in XSD Schema:


Line in ETD:


Line in Java Collaboration (crPsytekkNedomGetDetail_GAMS):
getShowChangeOrder().getChangeOrder().getCostRecordHead(iCost).getCostVariety(iCostVariety).setCostPrevious(STCTypeConverter.toBigDecimal(dblAttr).setScale(10, BigDecimal.ROUND_HALF_EVEN));
  

Line in Logfile input - CostPrevious:
14:45:18.874 COL D 9 (java_extensions.cxx:1442): #GAMS-DEBUG# crPsytekkNedomGetDetail_GAMS: getGetDetail().getCOST_VALUE(6).getCOST_PREV() = 0.0
 
Line in Logfile output - CostPrevious:
0E-10 ==> same as sent in XML.

--
The ETD rebuild doesn't resolve the issue as it would seem that the root cause of it is a Java API change.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms