[ 
https://issues.apache.org/jira/browse/LANG-1596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Eckart de Castilho updated LANG-1596:
---------------------------------------------
    Description: 
ArrayUtils.toPrimitive(Object) supports only Integer, Long, Short, Double and 
Float. Boolean, Byte, and Character are not supported.

This causes e.g. also calls to MethodUtils.invokeStaticMethod(...) to fail if 
e.g. a Boolean array is provided as the argument for a primitive boolean vararg 
because getVarArgs does expect ArrayUtils to do the right thing:

{code}
        if (varArgComponentType.isPrimitive()) {
            // unbox from wrapper type to primitive type
            varArgsArray = ArrayUtils.toPrimitive(varArgsArray);
        }
{code}

  was:
ArrayUtils.toPrimitive(Object) supports only Integer, Long, Short, Double and 
Float. Boolean, Byte, and Character are not supported.

This causes e.g. also calls to MethodUtils.invokeStaticMethod(...) to fail if 
e.g. a Boolean array is provided as the argument for a primitive boolean vararg 
because getVarArgs does expect ArrayUtils to do the right thing:

        if (varArgComponentType.isPrimitive()) {
            // unbox from wrapper type to primitive type
            varArgsArray = ArrayUtils.toPrimitive(varArgsArray);
        }


> ArrayUtils.toPrimitive(Object) does not support boolean and other types
> -----------------------------------------------------------------------
>
>                 Key: LANG-1596
>                 URL: https://issues.apache.org/jira/browse/LANG-1596
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.11
>            Reporter: Richard Eckart de Castilho
>            Priority: Major
>
> ArrayUtils.toPrimitive(Object) supports only Integer, Long, Short, Double and 
> Float. Boolean, Byte, and Character are not supported.
> This causes e.g. also calls to MethodUtils.invokeStaticMethod(...) to fail if 
> e.g. a Boolean array is provided as the argument for a primitive boolean 
> vararg because getVarArgs does expect ArrayUtils to do the right thing:
> {code}
>         if (varArgComponentType.isPrimitive()) {
>             // unbox from wrapper type to primitive type
>             varArgsArray = ArrayUtils.toPrimitive(varArgsArray);
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to