Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 45744 invoked from network); 13 Sep 2007 07:57:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Sep 2007 07:57:57 -0000 Received: (qmail 19630 invoked by uid 500); 13 Sep 2007 07:57:48 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 19564 invoked by uid 500); 13 Sep 2007 07:57:48 -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 19555 invoked by uid 99); 13 Sep 2007 07:57:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2007 00:57:48 -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; Thu, 13 Sep 2007 07:59:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6B8C471420B for ; Thu, 13 Sep 2007 00:57:32 -0700 (PDT) Message-ID: <27384957.1189670252438.JavaMail.jira@brutus> Date: Thu, 13 Sep 2007 00:57: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: TestCollections266.java I have updated the test and now it fails before the patch and is successful after. In the test, the hash code of KEY_266 depends of the current (simulated) JVM (like System.identityHashCode() ). HTH > 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: COLLECTIONS-266.patch, MultiKey.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.