Description
In relation to issue https://issues.apache.org/jira/browse/AXIS2-5342,
generated code for type:
<simpleType name="INTERO3_TYPE"> <restriction base="integer"> <totalDigits value="3"/> </restriction> </simpleType>
produces a class with setter:
public void setINTERO3_TYPE(java.math.BigInteger param) { java.lang.String totalDigitsDecimal = org.apache.axis2.databinding.utils.ConverterUtil.convertToStandardDecimalNotation("3").toPlainString(); if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, totalDigitsDecimal) < 0) { this.localINTERO3_TYPE = param; } else { throw new java.lang.RuntimeException( "Input values do not follow defined XSD restrictions"); } }
ConverterUtil.convertToStandardDecimalNotation produces a BigDecimal with a toPlainString() value "1000.0", but ConverterUtil.compare(BigInteger, String) contains code:
ConverterUtil.java:1344
public static long compare(BigInteger binBigInteger, String value) { return binBigInteger.longValue() - Long.parseLong(value); }
which parses second string parameter as a Long, throwing a NumberFormatException
Attachments
Issue Links
- Blocked
-
AXIS2-5342 Generated code for xsd:totalDigits cause errors
- Resolved
- duplicates
-
AXIS2-5724 totalDigits Facet of XSD type int incorrectly treated in databinding
- Resolved