Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 20 May 2011 07:21:08 -0500 Date: Fri, 20 May 2011 05:20:57 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Did the sort do anything? References: <9303hcFq0nU1@mid.individual.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 32 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 75.8.126.96 X-Trace: sv3-AeE3e7BCYsWtO9BlExqTp2VnSLEbKVavCO26vF0uM2XOWBz4571Y9hLwGGVxgkkMM2KPROpFt9JyfcW!bKxbIZXLR5pEf6sE9JbubVa6X7kqylZCdlQKay13wBp5Sr93lRTLBy9qjwampDwoG78/A9iA71Uj!+Ed63NKtlhhV6LsNpSK5LE1knJR4z/UJmOTiPqflP5w= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3235 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4358 On 5/20/2011 5:00 AM, Patricia Shanahan wrote: > On 5/19/2011 11:46 PM, Lawrence D'Oliveiro wrote: >> In message, Patricia >> Shanahan wrote: >> >>> Now that we have clarified the fact that System.identityHashCode(x) is >>> not merely a synonym for x.hashCode(), have you changed your mind about >>> the need, or otherwise, for stability when sorting Java objects based on >>> the entire value of the object's fields? >> >> What do you think I said about “the need, or otherwise, for stability”? > > "If, on the other hand, you were sorting immutable objects of a Java > “reference” type where the key was the entire object state, then > stability would indeed be irrelevant, notwithstanding such types are not > considered “primitive”." > > [http://groups.google.com/group/comp.lang.java.programmer/msg/17e3a8e513ceab46] To further refresh your memory, the question I raised was whether you consider System.identityHashCode(x) to be part of the "entire object state" of the object referenced by x. If the answer is "yes", then sorts whose key is the entire object state are so extremely rare that I've never seen one. If the answer is "no", then even if the sort key is the entire object state, the subsequent program behavior, such as the performance of an IdentityHashMap, can be affected by whether the sort is stable or not, so stability is relevant. Patricia