That's the behavior I'd expect too. This did work at one point. No, it's not unintuitive. Least not for C programmers :-)
But I've got smoking gun evidence though that's not what's happening. I'm now wondering what's happening in these setters... Tx for making sure I wasn't spacing. > -----Original Message----- > From: Joe Germuska [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 13, 2005 2:24 PM > To: Joe Hertz; 'Struts Users Mailing List' > Subject: Re: BeanUtils hates me... > > At 2:15 PM -0500 3/13/05, Joe Hertz wrote: > >I'm sorry about how lame this question seems. I'm staring quite stunned > at > >what I'm seeing in my debugger right now, and I'm hoping someone can > explain > >the behavior. > > > >Using Struts 1.2.4 (BeanUtils 1.7). > > > >I have two objects: A UserEntity and a User. The User is a subclass of > >UserEntity. > > > >I call PropertyUtils.copyProperties(user, userEntity) and I'm watching a > map > >that was an element of the user object (and not of the userEntity) > getting > >blown away (almost as if the User Object itself was getting > reconstructed). > > > >Why does this happen? (I can post to commons-user if I absolutely have > to, > >but I'm hoping someone can explain this... > > Perhaps unintuitively, the order of arguments to copyProperties are > (dest, orig) i.e. (to, from) > http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanuti > ls/BeanUtils.html#copyProperties(java.lang.Object,%20java.lang.Object) > > So, by your example, user should be having all its properties set > according to their equivalent values in userEntity. > > joe > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com > "Narrow minds are weapons made for mass destruction" -The Ex --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]