Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 95343 invoked from network); 28 Sep 2006 04:26:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Sep 2006 04:26:01 -0000 Received: (qmail 37306 invoked by uid 500); 28 Sep 2006 04:26:00 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 37156 invoked by uid 500); 28 Sep 2006 04:26:00 -0000 Mailing-List: contact dev-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ibatis.apache.org Delivered-To: mailing list dev@ibatis.apache.org Received: (qmail 37144 invoked by uid 99); 28 Sep 2006 04:26:00 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Sep 2006 21:26:00 -0700 Authentication-Results: idunn.apache.osuosl.org header.from=rongrabowski@yahoo.com; domainkeys=good X-ASF-Spam-Status: No, hits=3.1 required=5.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,RCVD_IN_NJABL_PROXY DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [68.142.200.123] ([68.142.200.123:26094] helo=web30510.mail.mud.yahoo.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 3C/C3-05478-4DE4B154 for ; Wed, 27 Sep 2006 21:25:57 -0700 Received: (qmail 47286 invoked by uid 60001); 28 Sep 2006 04:25:53 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=bRQAv2ETz2TYaDB7/ls13rz6rV26C4/qXhuA9kVzKy3nBSN8CZUQI3GIW8zwAaO03GCgT4a5fHFTvmPnyUCjNCOD7dSy3cNQqJGfEVbz4ac8wKqjYj+NOgv6IWBh3wgs4kcdudzF5hsabymxDkv7ENblj56KeNumfVedYxePMBU= ; Message-ID: <20060928042553.47284.qmail@web30510.mail.mud.yahoo.com> Received: from [24.208.153.243] by web30510.mail.mud.yahoo.com via HTTP; Wed, 27 Sep 2006 21:25:53 PDT Date: Wed, 27 Sep 2006 21:25:53 -0700 (PDT) From: Ron Grabowski Subject: IBatisNet - HashCodeProvider.GetIdentityHashCode To: dev@ibatis.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N public static int GetIdentityHashCode(object obj)=0A{=0A System.Reflection.= MethodInfo methodInfo =3D null;=0A Type type =3D typeof(object);=0A methodI= nfo =3D type.GetMethod("GetHashCode");=0A return (int) methodInfo.Invoke(ob= j, null);=0A}=0A=0AWhy can't we call:=0A=0Apublic static int GetIdentityHas= hCode(object obj)=0A{=0A return obj.GetHashCode();=0A}=0A=0ADoes using refl= ection call the framework's GetHashCode method even if the object has overr= iden it?=0A=0ACan we cache the MethodInfo?=0A=0Apublic class HashCodeProvid= er=0A{=0A private static MethodInfo getHashCodeMethodInfo =3D null;=0A=0A s= tatic HashCodeProvider()=0A {=0A Type type =3D typeof(object);=0A getHash= CodeMethodInfo =3D type.GetMethod("GetHashCode");=0A }=0A=0A public static = int GetIdentityHashCode(object obj)=0A {=0A return (int)getHashCodeMethodI= nfo.Invoke(obj, null);=0A }=0A}