Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DBFA7952D for ; Tue, 29 May 2012 22:31:24 +0000 (UTC) Received: (qmail 16737 invoked by uid 500); 29 May 2012 22:31:24 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 16404 invoked by uid 500); 29 May 2012 22:31: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 16396 invoked by uid 99); 29 May 2012 22:31:23 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2012 22:31:23 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 745D9142857 for ; Tue, 29 May 2012 22:31:23 +0000 (UTC) Date: Tue, 29 May 2012 22:31:23 +0000 (UTC) From: "Hannes Erven (JIRA)" To: java-dev@axis.apache.org Message-ID: <49769653.13453.1338330683478.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (AXIS2-4190) WSDL2JAVA Not generating code for when databinding is ADB. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-4190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285198#comment-13285198 ] Hannes Erven commented on AXIS2-4190: ------------------------------------- For me, the change introduced in r1299667 continously generates RuntimeExceptions. See axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl at about line 490: The problem seems to lie in ConverterUtil.convertToStandardDecimalNotation("31").toString() which returns 10E31. I guess that should rather be ConverterUtil.convertToStandardDecimalNotation("31").toPlainString() the retrieve the full number. Furthermore, it seems that the next line's comparison is done just the wrong way round: set the value if it is greater than the maximum? + if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, totalDigitsDecimal) > 0){ + this.=param; + } + else { + throw new java.lang.RuntimeException(); + } Since the issues I get are all in the generated code they are easy to work around. > WSDL2JAVA Not generating code for when databinding is ADB. > ---------------------------------------------------------------------------- > > Key: AXIS2-4190 > URL: https://issues.apache.org/jira/browse/AXIS2-4190 > Project: Axis2 > Issue Type: Bug > Components: adb, codegen > Affects Versions: 1.3, 1.4, 1.4.1 > Environment: Any > Reporter: Colin Anderson > Assignee: Kishanthan Thangarajah > Fix For: 1.6.2, 1.7.0 > > Attachments: AXIS2-4190.patch > > > I have the following definition in an XSD: > > > Standard tariff ID > > > > > > When I generate the Java code I get the TariffID type as expected, but in the generated setTariffID(int) method, there is no code generated that captures the restriction: > /** > * Auto generated setter method > * @param param TariffID > */ > public void setTariffID(int param){ > this.localTariffID=param; > } > If I then add either or and to the XSD then these restrictions are captured in the generated code. For example, this: > > > Standard tariff ID > > > > > > > > results in the following Java code being generated: > /** > * Auto generated setter method > * @param param TariffID > */ > public void setTariffID(int param){ > if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "9999999") <= 0){ > this.localTariffID=param; > } > else { > throw new java.lang.RuntimeException(); > } > if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0){ > this.localTariffID=param; > } > else { > throw new java.lang.RuntimeException(); > } > } > I and others on the user mailing list believe this is a bug in the ADB databinding code generation. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org