axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heinz Pferschy (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-4166) MIN_VALUEs for byte, short, int and long are used in corresponding wrapper classes to indicate null values. The nillable attribute should be used to indicate null values
Date Thu, 04 Dec 2008 14:47:44 GMT
MIN_VALUEs for byte, short, int and long  are used in corresponding wrapper classes to indicate
null values. The nillable attribute should be used to indicate null values
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-4166
                 URL: https://issues.apache.org/jira/browse/AXIS2-4166
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.3, 1.4.1
            Reporter: Heinz Pferschy


The MIN_VALUEs for byte, short, int and long  are used in corresponding wrapper classes to
indicate null values. Therefore it is not possible to transport these MIN_VALUEs via SOAP.

E.g. It is not possible to use the value -127 for a byte

Example:
-------------
If the type in WSDL is defined as

  <xsd:simpleType name="LongValue">
      <xsd:restriction base="xsd:long"></xsd:restriction>
  </xsd:simpleType>

the following modification of the generated source is necessary to allow serialization of
Long.MIN_VALUE

  //Heinz Pferschy: bug fix to allow Long.MIN_VALUE 
  //    if (localLongValue==java.lang.Long.MIN_VALUE) {
  //
  //      throw new org.apache.axis2.databinding.ADBException ("property value cannot be null!!");
  //
  //    }
  //    else {
        xmlWriter.writeCharacters (org.apache.axis2.databinding.utils.ConverterUtil.convertToString
(localLongValue) );
  //    }

This bug is related to AXIS2-1272. 
The provided fix shouldn't use MIN_VALUEs for null values. The nillable attribute should be
used to indicate null values


-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message