Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 44811 invoked from network); 7 Mar 2006 07:58:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Mar 2006 07:58:10 -0000 Received: (qmail 98514 invoked by uid 500); 7 Mar 2006 07:58:01 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 98464 invoked by uid 500); 7 Mar 2006 07:58:00 -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 98453 invoked by uid 99); 7 Mar 2006 07:58:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Mar 2006 23:58:00 -0800 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; Mon, 06 Mar 2006 23:57:59 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax (Postfix) with ESMTP id CCD04D49F9 for ; Tue, 7 Mar 2006 07:57:38 +0000 (GMT) Message-ID: <176117377.1141718258821.JavaMail.jira@ajax> Date: Tue, 7 Mar 2006 07:57:38 +0000 (GMT) From: "Paulex Yang (JIRA)" To: harmony-dev@incubator.apache.org Subject: [jira] Created: (HARMONY-184) java.util.TimeZone's default implementation may cause many classes' serialization non-compatible with RI 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 java.util.TimeZone's default implementation may cause many classes' serialization non-compatible with RI -------------------------------------------------------------------------------------------------------- Key: HARMONY-184 URL: http://issues.apache.org/jira/browse/HARMONY-184 Project: Harmony Type: Bug Components: Classlib Reporter: Paulex Yang Priority: Critical Static factory methods, java.util.TimeZone.getInstance(String) and getDefault(), are only ways to get a TimeZone instance, but Harmony and RI uses different classes as default implementation, which cause serialization non-compatible. Further, all classes whose serialization form includes TimeZone won't compatible with RI, too, for example, java.util.Calendar(with subclass), java.text.DateFormat(with subclass), etc. But the incompatiblity is hard to be imputed to Harmony, because Harmony use API class SimpleTimeZone as default implementation, but RI use a non-API class, whose full name is sun.util.calendar.ZoneInfo. The reproduce procedure: 1. To serialize TimeZone object to a file in RI, run codes below in RI public void writeObject(){ TimeZone zone = TimeZone.getTimeZone("GMT"); ObjectOutputStream ooutput = null; try { ooutput = new ObjectOutputStream(new FileOutputStream("TimeZone.ser")); ooutput.writeObject(zone); } finally { try { if (null != ooutput) { ooutput.close(); } } catch (Exception e) { } } } 2. Trying to deserialize this object from file, run codes below public void readObject(){ ObjectInputStream oinput = null; try { oinput = new ObjectInputStream(new FileInputStream("TimeZone.ser")); TimeZone newObj = (TimeZone)oinput.readObject(); } finally { try { if (null != oinput) { oinput.close(); } } catch (Exception e) { } } } Run in RI, passes without any failure Run in Harmony, exception throwed as below: java.lang.ClassNotFoundException: sun.util.calendar.ZoneInfo at java.lang.Class.forName(Class.java:154) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2226) ... ... -- 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