Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 22220 invoked from network); 21 Dec 2005 14:17:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Dec 2005 14:17:57 -0000 Received: (qmail 81105 invoked by uid 500); 21 Dec 2005 14:17:53 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 81012 invoked by uid 500); 21 Dec 2005 14:17:52 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 81000 invoked by uid 99); 21 Dec 2005 14:17:52 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 06:17:52 -0800 Received: by ajax.apache.org (Postfix, from userid 99) id 2767BCB; Wed, 21 Dec 2005 15:17:30 +0100 (CET) From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 37987] - [beanutils] Proposition for "controlled" copy of bean properties In-Reply-To: X-Bugzilla-Reason: AssignedTo Message-Id: <20051221141730.2767BCB@ajax.apache.org> Date: Wed, 21 Dec 2005 15:17:30 +0100 (CET) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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=37987 ------- Additional Comments From adelino.rodrigues@emea.eu.int 2005-12-21 15:17 ------- (In reply to comment #1) > I don't understand how this behavior is inconsistent. Only the matching (same > name and type) properties can be copied. So, case 3, IMO is fine the way it's > implemented. A Project object doesn't have a purchaseNr property, so the > purchaseNr property can't be copied from the PurchaseItem object to the Project > object. However, what I do think might be nice is if we had an additional > parameter to copyProperties() which specified exactly which properties to copy > (a collection/array of Strings which specified the property names). This would > be a bit more flexible, because there could be instances where you can't use a > class/interface to specify which properties to copy (you don't want to copy the > "id" property for instance). Would that work for you? We could actually > provide both, I guess so that you wouldn't have to manually construct the > collection of property names by hand. For instance you get (EditablePriceableItem a, EditablePriceableItem b) as parameters of a function. The only you know about it is that they are instances of EditablePriceableItem. Thus when copying a to b using introspections you don't want to alter properties that are outside of your scope: here the interface EditablePriceableItem. A 3rd argument, as you propose (and as proposed in enhancement 32642), would do the job. Neverthless, getting a list of property names from an interface that potentially extends several other interfaces is not trivial. It would then be very handy to have an helper method such as: getReadableProperties(Class aclass): List/or array getSettableProperties(Class aclass): List/or array -- 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