doh! the map can be passed straight into populate. i don't know why i missed this before...

- robert

On Saturday, November 30, 2002, at 04:39 PM, Craig R. McClanahan wrote:


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

Date: Thu, 28 Nov 2002 20:07:09 +0000
From: robert burrell donkin <[EMAIL PROTECTED]>
Reply-To: Jakarta Commons Developers List <commons-
[EMAIL PROTECTED]>
To: Jakarta Commons Developers <[EMAIL PROTECTED]>
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:[EMAIL PROTECTED].
org>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED].
org>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to