Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 92057 invoked from network); 1 Jun 2009 07:58:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Jun 2009 07:58:20 -0000 Received: (qmail 25443 invoked by uid 500); 1 Jun 2009 07:58:32 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 25383 invoked by uid 500); 1 Jun 2009 07:58:31 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 25374 invoked by uid 99); 1 Jun 2009 07:58:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 07:58:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jun 2009 07:58:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B578A234C004 for ; Mon, 1 Jun 2009 00:58:07 -0700 (PDT) Message-ID: <850577827.1243843087732.JavaMail.jira@brutus> Date: Mon, 1 Jun 2009 00:58:07 -0700 (PDT) From: "Kevin Zhou (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-6221) [classlib][beans] java.beans.XMLEncoder.writeObject(obj) outputs different contents of the modified field of super class from RI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [classlib][beans] java.beans.XMLEncoder.writeObject(obj) outputs different contents of the modified field of super class from RI -------------------------------------------------------------------------------------------------------------------------------- Key: HARMONY-6221 URL: https://issues.apache.org/jira/browse/HARMONY-6221 Project: Harmony Issue Type: Bug Components: Classlib Affects Versions: 5.0M9 Reporter: Kevin Zhou Fix For: 5.0M10 Given a test case [1], ChildClass extends ParentClass which contains a class field. If we use java.beans.XMLEncoder to write a object of ChildClass after invoking super.setClazz() method to modify the value of class field, (for example, from Collection.class to ChildClass.class) the output will be different from RI's output. In fact, HARMONY creates an additional id for the class object. I think it is unnecessary. HARMONY outputs: hy.issue2.XMLEncoderTest$ChildClass RI outputs: hy.issue2.XMLEncoderTest$ChildClass [1] Test Case: public static class ParentClass { Class clazz = Collection.class; public Class getClazz() { return clazz; } public void setClazz(Class clazz) { this.clazz = clazz; } } public static class ChildClass extends ParentClass { } public void test_XMLEncoder_writeObject() throws Exception { ChildClass child = new ChildClass(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); XMLEncoder xmlEncoder = new XMLEncoder(bos); child.setClazz(ChildClass.class); xmlEncoder.writeObject(child); xmlEncoder.close(); System.out.println(bos.toString()); } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.