commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: [beanutils] little bug with indexed primitive types and null values
Date Fri, 08 Sep 2006 10:26:35 GMT
Mario,

No problem with you jumping in and fixing beanutils bugs, but next
time could you log it by creating a JIRA ticket please.

Niall

P.S. Thanks :-)

On 9/5/06, Mario Ivankovits <mario@ops.co.at> wrote:
> Hi!
>
> I've found a little bug in beanutils where, in case of indexed primitive
> types (e.g. boolean array) a null value gets not correctly converterd.
> If nobody minds I'll commit the following patch for beanuilts:
>
> Index: src/java/org/apache/commons/beanutils/BeanUtilsBean.java
> ===================================================================
> --- src/java/org/apache/commons/beanutils/BeanUtilsBean.java
> (Revision 440283)
> +++ src/java/org/apache/commons/beanutils/BeanUtilsBean.java
> (Arbeitskopie)
> @@ -1021,7 +1021,7 @@
>                  newValue = value;
>              }
>          } else if (type.isArray()) {         // Indexed value into array
> -            if (value instanceof String) {
> +            if (value instanceof String || value == null) {
>                  newValue = getConvertUtils().convert((String) value,
>                                                  type.getComponentType());
>              } else if (value instanceof String[]) {
>
>
> Test cases still pass, and now our application will work too.
>
> Thanks!
> Ciao,
> Mario

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message