Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 28988 invoked from network); 11 Sep 2007 21:06:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2007 21:06:54 -0000 Received: (qmail 28929 invoked by uid 500); 11 Sep 2007 21:06:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 28856 invoked by uid 500); 11 Sep 2007 21:06:46 -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 28847 invoked by uid 99); 11 Sep 2007 21:06:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2007 14:06:46 -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; Tue, 11 Sep 2007 21:06:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1305E714159 for ; Tue, 11 Sep 2007 14:06:32 -0700 (PDT) Message-ID: <25245417.1189544792051.JavaMail.jira@brutus> Date: Tue, 11 Sep 2007 14:06:32 -0700 (PDT) From: "Julien Buret (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (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:all-tabpanel ] Julien Buret updated COLLECTIONS-266: ------------------------------------- Attachment: MultiKey.java Here is the updated source file. Hope this help. > 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 > Attachments: MultiKey.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.