axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Kruse Pedersen (JIRA)" <>
Subject [jira] Created: (AXIS2-3329) Problem parsing integer with leading zeros...
Date Thu, 08 Nov 2007 13:49:50 GMT
Problem parsing integer with leading zeros...

                 Key: AXIS2-3329
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.3
         Environment: Windows XP
            Reporter: Lars Kruse Pedersen

I have the following xsd,

<xs:simpleType name="UnderkontoArtKodeType">            
         <xs:documentation>Angiver typen af afregning</xs:documentation>     
      <xs:restriction base="xs:integer">
         <xs:pattern value="[0-9]{3}"/>
         <xs:totalDigits value="3"/>

When I receive XML with leading zeros, as in "001", ADB throws an exception....

Looking at the generated ADB kode:

public void setUnderkontoArtKodeType(java.math.BigInteger param) {
        if (java.lang.String.valueOf(param).matches("[0-9]{3}")) {
            this.localUnderkontoArtKodeType = param;
        } else {
            throw new java.lang.RuntimeException();

It is clear why it fails, the "001" has already been converted to an integer, and when the
set method is called it takes the 1 and converts it to a string "1", and then tries to validate
for containing 3 digits...

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message