Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 58141 invoked from network); 14 Sep 2007 10:13:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Sep 2007 10:13:57 -0000 Received: (qmail 74185 invoked by uid 500); 14 Sep 2007 10:13:47 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 74100 invoked by uid 500); 14 Sep 2007 10:13:47 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 74089 invoked by uid 99); 14 Sep 2007 10:13:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2007 03:13:47 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2007 10:13:53 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2700F714159 for ; Fri, 14 Sep 2007 03:13:32 -0700 (PDT) Message-ID: <19906645.1189764812150.JavaMail.jira@brutus> Date: Fri, 14 Sep 2007 03:13:32 -0700 (PDT) From: "Julien Buret (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (COLLECTIONS-266) Issue with MultiKey when serialized/deserialized via RMI In-Reply-To: <20828754.1189544672037.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COLLECTIONS-266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527440 ] Julien Buret commented on COLLECTIONS-266: ------------------------------------------ Ah ok ;) Well then it should be ok: http://java.sun.com/docs/books/jls/second_edition/html/binaryComp.doc.html#45154 > Issue with MultiKey when serialized/deserialized via RMI > -------------------------------------------------------- > > Key: COLLECTIONS-266 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-266 > Project: Commons Collections > Issue Type: Bug > Components: KeyValue > Affects Versions: 3.2 > Reporter: Julien Buret > Priority: Minor > Fix For: 3.3 > > Attachments: COLLECTIONS-266.patch, MultiKey.java, TestCollections266.java, TestCollections266.java, TestCollections266.java > > > This is because the hash code of MultiKey is calculated only once. > So if the MultiKey is deserialized in an other jvm, and if one at least of the subkeys defines its hash code with System.identityHashCode() (for example all the enums does), then the hash code of the MultiKey is no longer valid, and you can't retreive the key in your Map. > I fixed it by making the cached hash code field transient, and by recalculating the hash code during deserialization. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.