axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vilnis Termanis (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded
Date Sun, 13 Nov 2011 20:53:52 GMT
Null as first element in non-primitive array causes other array elements to be disregarded
------------------------------------------------------------------------------------------

                 Key: AXIS2-5183
                 URL: https://issues.apache.org/jira/browse/AXIS2-5183
             Project: Axis2
          Issue Type: Bug
          Components: adb, databinding
    Affects Versions: 1.6.1, 1.6.0
            Reporter: Vilnis Termanis


Procedure:

1) Create service function (e.g. POJO) which has an array parameter, e.g.:
public static boolean testFunc(Integer[] integers) {
  if (integers != null) {
    System.out.println(integers.length);
  } else {
    System.out.println("null");
  }
}

2) Send request with null as first element, e.g.:
<ns1:testFunc><ns1:integers/><ns1:integers>1</ns1:integers><ns1:integers>2</ns1:integers></ns1:testFunc>

3) Send request with null as non-first element, e.g.:
<ns1:testFunc><ns1:integers>1</ns1:integers><ns1:integers/><ns1:integers>2</ns1:integers></ns1:testFunc>

Result:

2) Array of length 0 (i.e. null) received - WRONG
3) Array of length 3 received (1, null, 2, as expected)

Reason:
BeanUtil.java ignores non-null elements of an array if the first element is null.

--
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


Mime
View raw message