[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kandula-dev
Subject:    [jira] [Commented] (AXIS2-5789) Generated code for xsd:totalDigits throws NumberFormatException
From:       "Robert Lazarski (Jira)" <jira () apache ! org>
Date:       2020-06-10 3:49:00
Message-ID: JIRA.12980159.1466159946000.214779.1591760940132 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/AXIS2-5789?page=com.atlassian.jira.plugin. \
system.issuetabpanels:comment-tabpanel&focusedCommentId=17130029#comment-17130029 ] 

Robert Lazarski commented on AXIS2-5789:
----------------------------------------

There was a patch in another issue, AXIS2-5724.

We committed that fix to source control however we just moved the project to from svn \
to git and haven't done a new release yet.  

In the meantime, you could try removing your adb module jar and replacing it with \
this jar from the latest build:  

https://repository.apache.org/content/groups/snapshots/org/apache/axis2/axis2-kernel/1.8.0-SNAPSHOT/axis2-kernel-1.8.0-20200607.164351-787.jar


  

> 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 Rodi
> Priority: Major
> 
> In relation to issue [https://issues.apache.org/jira/browse/AXIS2-5342],
> generated code for type:
> {code:xml}
> <simpleType name="INTERO3_TYPE">
> <restriction base="integer">
> <totalDigits value="3"/>
> </restriction>
> </simpleType>
> {code}
> produces a class with setter:
> {code:java}
> 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");
> }
> }
> {code}
> ConverterUtil.convertToStandardDecimalNotation produces a BigDecimal with a \
> toPlainString() value "1000.0", 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
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic