commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject [beanutils] little bug with indexed primitive types and null values
Date Tue, 05 Sep 2006 08:16:58 GMT
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