Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ECF67200C8E for ; Thu, 8 Jun 2017 13:45:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EB9AE160BD5; Thu, 8 Jun 2017 11:45:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3C3DA160BCA for ; Thu, 8 Jun 2017 13:45:29 +0200 (CEST) Received: (qmail 15107 invoked by uid 500); 8 Jun 2017 11:45:23 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 15083 invoked by uid 99); 8 Jun 2017 11:45:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jun 2017 11:45:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5A8E1188A5C for ; Thu, 8 Jun 2017 11:45:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id RG6gaN_BNxIY for ; Thu, 8 Jun 2017 11:45:20 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 331B35FBBB for ; Thu, 8 Jun 2017 11:45:20 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3C1F1E0D3D for ; Thu, 8 Jun 2017 11:45:19 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6069721E11 for ; Thu, 8 Jun 2017 11:45:18 +0000 (UTC) Date: Thu, 8 Jun 2017 11:45:18 +0000 (UTC) From: "khalithbasha (JIRA)" To: java-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AXIS2-5342) Generated code for xsd:totalDigits cause errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 08 Jun 2017 11:45:30 -0000 [ https://issues.apache.org/jira/browse/AXIS2-5342?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1604= 2586#comment-16042586 ]=20 khalithbasha commented on AXIS2-5342: ------------------------------------- Exception in thread "main" java.lang.NumberFormatException: For input strin= g: "1000.0" public void setEMPL_RCDTypeDef(int param) { java.lang.String totalDigitsDecimal =3D org.apache.axis2.databi= nding.utils.ConverterUtil.convertToStandardDecimalNotation( "3").toPlainString(); if (org.apache.axis2.databinding.utils.ConverterUtil.compare( param, totalDigitsDecimal) < 0) { this.localEMPL_RCDTypeDef =3D param; } else { throw new java.lang.RuntimeException( "Input values do not follow defined XSD restrictions"); } } > Generated code for xsd:totalDigits cause errors > ----------------------------------------------- > > Key: AXIS2-5342 > URL: https://issues.apache.org/jira/browse/AXIS2-5342 > Project: Axis2 > Issue Type: Bug > Components: adb, codegen > Affects Versions: 1.6.2 > Reporter: Conny Krey=C3=9Fel > Fix For: 1.6.3, 1.7.0 > > > If you have a element like > > =09 > =09=09 > =09 > > axis generates this as source code =20 > public void setAbc(java.math.BigInteger param){ > =09java.lang.String totalDigitsDecimal =3D org.apache.axis2.databinding.u= tils.ConverterUtil.convertToStandardDecimalNotation("5").toString(); > =09if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, to= talDigitsDecimal) > 0){ > =09=09this.localHerkunftsschluessel=3Dparam; > =09} > =09else { > =09=09throw new java.lang.RuntimeException(); > =09} > } > The problem is the toString() of the result from .convertToStandardDecima= lNotation("5"). It converts the a BigDecimal into String and this results i= n "10000.0". Then ConverterUtil.compare() trys to convert this string into = a Long. BANG. > Please change convertToStandardDecimalNotation().toString() into convertT= oStandardDecimalNotation().toPlainString(). > The same functionality should be evaluated for xsd:int, xsd:float, xsd:de= cimal ... > IMHO, this results from a bad implementation of AXIS2-4190. Please add te= stcases for this. > Take a look at the following comment and below. > https://issues.apache.org/jira/browse/AXIS2-4190?focusedCommentId=3D13285= 198&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel= #comment-13285198 -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org