commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [beanutils] BeanUtils.copyProperties support for non-simple properties...?
Date Sat, 30 Nov 2002 16:39:38 GMT


On Thu, 28 Nov 2002, robert burrell donkin wrote:

> Date: Thu, 28 Nov 2002 20:07:09 +0000
> From: robert burrell donkin <robertburrelldonkin@blueyonder.co.uk>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: Jakarta Commons Developers <commons-dev@jakarta.apache.org>
> Subject: [beanutils] BeanUtils.copyProperties support for non-simple
>     properties...?
>
> the following bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14470
> boils down to copyProperty calling setSimpleProperty rather than
> setProperty. since this is (just) in the java docs, i'm reluctant to
> change this in case there's a good reason why it was written like this.
>
> does anyone know a reason why it was done like this?
>

The original intent was to perform a "shallow copy" of the properties in
an origin bean to a destination bean, in a manner reminiscent of what the
java.lang.Object.clone() method is supposed to do.

The issue of non-simple properties only matters for a Map as the source
(and, if we add it, a Map as the destination).  This is one of the places
I'm not clear what makes the most sense in our seeming quest to treat Maps
like beans for some purposes.

Maybe the best thing to do would be to separate out the copy-from-map
operation into a separate method that complements describe()?  Such a
method could easily support non-simple properties -- it would be a generic
way to load properties into an entire existing tree.

> (if it right, i'll improve the documentation and mark the bug as WONTFIX.)
>
> - robert
>

Craig


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


Mime
View raw message