It appears there is a bug in BeanUtils.populate() for an indexed setter
of array type.  It doesn't take into account that it is an indexed
setter and that the second parameter is an array because it only checks
the first parameter which is always an int for an indexed setter.  This
is the code in the 1.0.1 release:
 
           ...
            Class parameterType = parameterTypes[0];
            if (parameterTypes.length > 1)
                parameterType = parameterTypes[1];      // Indexed
setter
            // Convert the parameter value as required for this setter
method
            Object parameters[] = new Object[1];
            if (parameterTypes[0].isArray()) {
          ...
 
it should be as follows:
 
           ...
            Class parameterType = parameterTypes[0];
            if (parameterTypes.length > 1)
                parameterType = parameterTypes[1];      // Indexed
setter
            // Convert the parameter value as required for this setter
method
            Object parameters[] = new Object[1];
            if (parameterType.isArray()) {
          ...
 


Reply via email to