You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Stefano R (JIRA)" <ji...@apache.org> on 2016/06/17 10:40:05 UTC
[jira] [Created] (AXIS2-5789) Generated code for xsd:totalDigits
throws NumberFormatException
Stefano R created AXIS2-5789:
--------------------------------
Summary: Generated code for xsd:totalDigits throws NumberFormatException
Key: AXIS2-5789
URL: https://issues.apache.org/jira/browse/AXIS2-5789
Project: Axis2
Issue Type: Bug
Components: adb, codegen
Affects Versions: 1.7.3
Reporter: Stefano R
In relation to issue [https://issues.apache.org/jira/browse/AXIS2-5342],
generated code for type:
{code:xml}
<simpleType name="INTERO15_TYPE">
<restriction base="integer">
<totalDigits value="15"/>
</restriction>
</simpleType>
{code}
produces a class with setter:
{code:java}
public void setINTERO15_TYPE(java.math.BigInteger param) {
java.lang.String totalDigitsDecimal = org.apache.axis2.databinding.utils.ConverterUtil.convertToStandardDecimalNotation("15").toPlainString();
if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, totalDigitsDecimal) < 0) {
this.localINTERO15_TYPE = param;
} else {
throw new java.lang.RuntimeException(
"Input values do not follow defined XSD restrictions");
}
}
{code}
ConverterUtil.convertToStandardDecimalNotation produces a decimal value, but ConverterUtil.compare(BigInteger, String) contains code:
{code:java|title=ConverterUtil.java:1344}
public static long compare(BigInteger binBigInteger, String value) {
return binBigInteger.longValue() - Long.parseLong(value);
}
{code}
which parses second string parameter as a Long, throwing a NumberFormatException
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org