Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 45039 invoked from network); 30 Aug 2006 18:01:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Aug 2006 18:01:11 -0000 Received: (qmail 4932 invoked by uid 500); 30 Aug 2006 18:01:09 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 4796 invoked by uid 500); 30 Aug 2006 18:01:08 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 4785 invoked by uid 99); 30 Aug 2006 18:01:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 11:01:08 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=DNS_FROM_RFC_BOGUSMX X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [207.162.51.5] (HELO pandore.ircm.priv) (207.162.51.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 11:01:07 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: bug in javabeans setter (ComplexBeanProbe.java)? Date: Wed, 30 Aug 2006 14:00:42 -0400 Message-ID: <5820E7E2A928DB46824297946AC2024A9A5F88@pandore.ircm.priv> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: bug in javabeans setter (ComplexBeanProbe.java)? Thread-Index: AcbLl6ato7P/B0PvRfW0lWqNyPRPKwAEu0bgACzgvoA= From: "Poitras Christian" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Can you post a copy of your setters? I'm not sure what you're trying to ask or to do. Christian -----Original Message----- From: Adam Klein [mailto:Adam.Klein@aqr.com]=20 Sent: Tuesday, 29 August 2006 16:41 To: user-java@ibatis.apache.org Subject: bug in javabeans setter (ComplexBeanProbe.java)? Apologies if this is posted twice, I don't think my first one made it. I had implemented defensive copying on my javabean setter methods - ie, so the value of the bean would be set to a COPY of the parameter - while the getter would return a direct reference. Then, when I was trying to set keys in an (uninitiailized) HashMap object to values like this: I got a very strange result: of the values in myHashMap, only the value of myHashMap.key2 would be set; in general, the first key of an (uninitialized) HashMap would never be assigned a value. I traced the reason to the ComplexBeanProbe.java file, in the setObject method: it called the method setObject(parent, property, child) prior to calling setProperty(child, property, value), which meant that the parent.child object no longer referenced the child object by the time the code attempted to set values on the child object (due specifically to my defensive copying). If myHashMap is initialized to an empty HashMap value on creation of MyClass, there are no problems. The question is, is this just a symptom of defensive copying, or is this a bug, where setProperty(child, property, value) should be called first? Regards, Adam =20 =20 =20 =20 =20 Disclaimer: This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please notify the sender immediately and destroy/delete this e-mail. You are hereby notified that any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly prohibited. =20 This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All information contained in this communication is not warranted as to completeness or accuracy and is subject to change without notice. Any comments or statements made in this communication do not necessarily reflect those of AQR Capital Management, LLC and its affiliates.