commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34020] New: - PropertyUtils.copyProperties seems to call Constructor
Date Tue, 15 Mar 2005 17:18:26 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34020>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34020

           Summary: PropertyUtils.copyProperties seems to call Constructor
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: jhertz@speakeasy.net


Using BeanUtils 1.7

I Have two classes X and Y. 

Y is a subclass of X. Y has a default constructor that initializes some class 
properties that are NOT present in X (in my example, the constructor creates 2 
objects and places them into a map).

When I call PropertyUtils.copyProperties(Y,X) what I am finding is the 
following:

The properties of X ARE copied onto Y, no problem. That part works.

But Y's constructor seems to get called inside of copyProperties(). (The 
instance of Y passed in is NOT the same instance of Y that is returned?). In 
any case, the initializations declared in Y's constructor occured, and blew 
away the current state on the property that got "re-initialized". 

copyProperties(Y,X) should not have touched this element of Y as it is NOT an 
element of X.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message