Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 83821 invoked from network); 16 May 2010 09:53:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 May 2010 09:53:36 -0000 Received: (qmail 63110 invoked by uid 500); 16 May 2010 09:53:36 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 62999 invoked by uid 500); 16 May 2010 09:53:35 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 62989 invoked by uid 99); 16 May 2010 09:53:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 May 2010 09:53:34 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=AWL,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.179.121.37] (HELO viefep17-int.chello.at) (62.179.121.37) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 May 2010 09:53:28 +0000 Received: from edge04.upcmail.net ([192.168.13.239]) by viefep17-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100516095302.YBHD2513.viefep17-int.chello.at@edge04.upcmail.net> for ; Sun, 16 May 2010 11:53:02 +0200 Received: from [192.168.1.50] ([84.74.100.246]) by edge04.upcmail.net with edge id J9t11e01E5JxopQ049t2NE; Sun, 16 May 2010 11:53:02 +0200 X-SourceIP: 84.74.100.246 Message-ID: <4BEFC02A.2070906@apache.org> Date: Sun, 16 May 2010 11:51:38 +0200 From: Felix Knecht Reply-To: felixk@apache.org User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100509 Thunderbird/3.0.4 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Mutable Objects References: <4BEE633D.6020906@otego.com> <4BEE8756.5010403@gmail.com> In-Reply-To: <4BEE8756.5010403@gmail.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=BX1z5e3lS7RAKjOkUI/uDpZ/pP4xz0N/VImyOZX9Sfk= c=1 sm=0 a=2caWB_DcjroA:10 a=pXoq77xVGrQA:10 a=8nJEP1OIZ-IA:10 a=xe8BsctaAAAA:8 a=EDYI9IttvL-7yOUeS2wA:9 a=hg4IIw8nbn6ewR_RS9WjzOCP04UA:4 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> I suggest to clone such data and return the clone instead. >> >> WDYT? >> > This is not so simple. For instance, in the Value class, we returns the > direct internal object for performance reasons. It should be checked > case by case. I can agree the performance reasons. OTOH it's a 'public' class which may be used by other (third party) projects as well. For these projects we will need to have either a big warning in the javadocs or to implement it in a save way. > > If we consider that the returned value is ok even if it's not a clone, > then we should add a @suppressWarnig with a comment explaining why we > are allowing such a behavior. > > Otherwise, returning a clone is an option, another option being that we > return an Immutable object, ie the interned object should be immutable > (but this is more work). > -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvvwCkACgkQ2lZVCB08qHEN4wCgkIcD9v/hJ01z+is5WTgMbEK3 ROwAoJotkDX8difP4XkrZbzWlks1y30j =ee07 -----END PGP SIGNATURE-----