Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 15237 invoked from network); 7 Mar 2006 13:30:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Mar 2006 13:30:54 -0000 Received: (qmail 41931 invoked by uid 500); 7 Mar 2006 13:30:48 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 41648 invoked by uid 500); 7 Mar 2006 13:30:47 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 41637 invoked by uid 99); 7 Mar 2006 13:30:47 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Mar 2006 05:30:47 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax (Postfix) with ESMTP id 86A7C6ACAD for ; Tue, 7 Mar 2006 13:29:40 +0000 (GMT) Message-ID: <301987724.1141738180549.JavaMail.jira@ajax> Date: Tue, 7 Mar 2006 13:29:40 +0000 (GMT) From: "Dmitry M. Kononov (JIRA)" To: harmony-dev@incubator.apache.org Subject: [jira] Updated: (HARMONY-187) java.io.ObjectOutputStream.writeUnshared() works incorrectly. In-Reply-To: <1952855413.1141738059066.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-187?page=all ] Dmitry M. Kononov updated HARMONY-187: -------------------------------------- Attachment: Test16.java > java.io.ObjectOutputStream.writeUnshared() works incorrectly. > ------------------------------------------------------------- > > Key: HARMONY-187 > URL: http://issues.apache.org/jira/browse/HARMONY-187 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Dmitry M. Kononov > Attachments: Test16.java > > Say, we write the same object by the following code: > Object o = "foobar"; > oos.writeObject(o); > oos.writeUnshared(o); > oos.writeObject(o); > And then, read the written data by the code as follows: > Object[] oa = new Object[3]; > for (int i = 0; i < oa.length; i++) { > oa[i] = ois.readObject(); > } > We expect that: > 1) the 0th and 1st elements of the array are not equal. That is, oa[0] != oa[1]. > 2) the 1st and 2nd elements of the array are not equal. That is, oa[1] != oa[2]. > 3) the 0th and 2nd elements of the array are equal. That is, oa[0] == oa[2]. > All the three conditions are true if we run a test case in RI: > oa[0] != oa[1] - true > oa[1] != oa[2] - true > oa[0] == oa[2] - true > When we run the test case in Harmony the first condition is true and the rest two are false. > oa[0] != oa[1] - true > oa[1] != oa[2] - false > oa[0] == oa[2] - false > Here is an excerpt from the spec which shows us that Harmony behaves incorrectly: > "If writeObject is used to write an object that has been previously written with writeUnshared, the previous writeUnshared operation is treated as if it were a write of a separate object. In other words, ObjectOutputStream will never generate back-references to object data written by calls to writeUnshared" > Please note also, that oa[2] should be back-referenced to oa[0]. > I will attach the test case. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira