craigmcc 02/01/26 20:12:42 Modified: beanutils/src/java/org/apache/commons/beanutils BeanUtils.java Log: Deal with indexed setters where the property type is itself an array. Clean up debug logging on DynaProperty beans. PR: Bugzilla #4485 Submitted by: Jason Chaffee <[EMAIL PROTECTED]> Revision Changes Path 1.12 +16 -9 jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java Index: BeanUtils.java =================================================================== RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- BeanUtils.java 24 Jan 2002 01:39:57 -0000 1.11 +++ BeanUtils.java 27 Jan 2002 04:12:42 -0000 1.12 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java,v 1.11 2002/01/24 01:39:57 craigmcc Exp $ - * $Revision: 1.11 $ - * $Date: 2002/01/24 01:39:57 $ + * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtils.java,v 1.12 2002/01/27 04:12:42 craigmcc Exp $ + * $Revision: 1.12 $ + * $Date: 2002/01/27 04:12:42 $ * * ==================================================================== * @@ -86,7 +86,7 @@ * @author Chris Audley * @author Rey François * @author Gregor Raıman - * @version $Revision: 1.11 $ $Date: 2002/01/24 01:39:57 $ + * @version $Revision: 1.12 $ $Date: 2002/01/27 04:12:42 $ */ public class BeanUtils { @@ -517,9 +517,15 @@ continue; } - if (log.isDebugEnabled()) - log.debug(" Property descriptor is '" + - descriptor + "'"); + if (log.isDebugEnabled()) { + if (descriptor != null) { + log.debug(" Property descriptor is '" + + descriptor + "'"); + } else /* if (dynaProperty != null) */ { + log.debug(" DynaProperty descriptor is '" + + descriptor + "'"); + } + } // Process differently for JavaBeans and DynaBeans @@ -560,7 +566,8 @@ // Convert the parameter value as required for this setter method Object parameters[] = new Object[1]; - if (parameterTypes[0].isArray()) { + // if (parameterTypes[0].isArray()) { + if (parameterType.isArray()) { if (value instanceof String) { String values[] = new String[1]; values[0] = (String) value; @@ -591,7 +598,7 @@ log.error(" CANNOT HAPPEN (setProperty()): ", e); } - } else { + } else /* if (dynaProperty != null) */ { // Handle scalar and indexed properties differently Object newValue = null;
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>