You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Vilnis Termanis (Created) (JIRA)" <ji...@apache.org> on 2011/11/13 21:53:52 UTC

[jira] [Created] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

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


[jira] [Assigned] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Sagara Gunathunga (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sagara Gunathunga  reassigned AXIS2-5183:
-----------------------------------------

    Assignee: Sagara Gunathunga 
    
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>            Assignee: Sagara Gunathunga 
>              Labels: BeanUtil, array, null
>             Fix For: 1.6.2, 1.7.0
>
>         Attachments: BeanUtil_Axis2_1.6.0.patch
>
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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 in ProcessElement() if the first element is null even if there is more than one element.

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


[jira] [Updated] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Vilnis Termanis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vilnis Termanis updated AXIS2-5183:
-----------------------------------

    Description: 
Procedure:

1) Create service function (e.g. POJO) which has an array parameter, e.g.:
public static boolean testFunc(Integer[] integers) {
  System.out.println((integers != null) ? integers.length : "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.

  was:
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.

    
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>              Labels: BeanUtil, array, null
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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


[jira] [Commented] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13150736#comment-13150736 ] 

Hudson commented on AXIS2-5183:
-------------------------------

Integrated in Axis2 #1107 (See [https://builds.apache.org/job/Axis2/1107/])
    Fixed AXIS2-5183.

sagara : 
Files : 
* /axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java

                
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>            Assignee: Sagara Gunathunga 
>              Labels: BeanUtil, array, null
>             Fix For: 1.6.2, 1.7.0
>
>         Attachments: BeanUtil_Axis2_1.6.0.patch
>
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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 in ProcessElement() if the first element is null even if there is more than one element.

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


[jira] [Updated] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Vilnis Termanis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vilnis Termanis updated AXIS2-5183:
-----------------------------------

    Description: 
Procedure:
1) Create service function (e.g. POJO) which has an array parameter, e.g.:
public static boolean testFunc(Integer[] integers) {
  System.out.println((integers != null) ? integers.length : "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 in ProcessElement() if the first element is null even if there is more than one element.

  was:
Procedure:
1) Create service function (e.g. POJO) which has an array parameter, e.g.:
public static boolean testFunc(Integer[] integers) {
  System.out.println((integers != null) ? integers.length : "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.

    
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>              Labels: BeanUtil, array, null
>         Attachments: BeanUtil_Axis2_1.6.0.patch
>
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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 in ProcessElement() if the first element is null even if there is more than one element.

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


[jira] [Resolved] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Sagara Gunathunga (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sagara Gunathunga  resolved AXIS2-5183.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.0
                   1.6.2

Fixed in r1201863.

Thanks for the patch. 
                
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>            Assignee: Sagara Gunathunga 
>              Labels: BeanUtil, array, null
>             Fix For: 1.6.2, 1.7.0
>
>         Attachments: BeanUtil_Axis2_1.6.0.patch
>
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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 in ProcessElement() if the first element is null even if there is more than one element.

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


[jira] [Updated] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Vilnis Termanis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vilnis Termanis updated AXIS2-5183:
-----------------------------------

    Description: 
Procedure:
1) Create service function (e.g. POJO) which has an array parameter, e.g.:
public static boolean testFunc(Integer[] integers) {
  System.out.println((integers != null) ? integers.length : "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.

  was:
Procedure:

1) Create service function (e.g. POJO) which has an array parameter, e.g.:
public static boolean testFunc(Integer[] integers) {
  System.out.println((integers != null) ? integers.length : "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.

    
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>              Labels: BeanUtil, array, null
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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


[jira] [Updated] (AXIS2-5183) Null as first element in non-primitive array causes other array elements to be disregarded

Posted by "Vilnis Termanis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vilnis Termanis updated AXIS2-5183:
-----------------------------------

    Attachment: BeanUtil_Axis2_1.6.0.patch

Potential solution (patch) by additionally checking that the array has more than one element.
                
> 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.0, 1.6.1
>            Reporter: Vilnis Termanis
>              Labels: BeanUtil, array, null
>         Attachments: BeanUtil_Axis2_1.6.0.patch
>
>
> Procedure:
> 1) Create service function (e.g. POJO) which has an array parameter, e.g.:
> public static boolean testFunc(Integer[] integers) {
>   System.out.println((integers != null) ? integers.length : "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