private void updateArrayProperty( final PropertyDescriptor pd, final PropertySpecification name, final Object o )
throws BeanException {
final Method readMethod = pd.getReadMethod();
if ( readMethod == null ) {
throw new BeanException( "Property is not readable, cannot perform array update: " + name );
}
try {
final Object value = readMethod.invoke( bean );
final int index = Integer.parseInt( name.getIndex() );
final Object array = validateArray( BeanUtility.getPropertyType( pd ), value, index );
Array.set( array, index, o );
final Method writeMethod = pd.getWriteMethod();
writeMethod.invoke( bean, array );
} catch ( BeanException e ) {
throw e;
} catch ( Exception e ) {
BeanUtility.logger.warn( "Failed to read property, cannot perform array update: " + name, e );
throw new BeanException( "Failed to read property, cannot perform array update: " + name );
}
}