Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 46601 invoked from network); 28 Nov 2006 08:39:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 08:39:43 -0000 Received: (qmail 12775 invoked by uid 500); 28 Nov 2006 08:39:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 12677 invoked by uid 500); 28 Nov 2006 08:39:52 -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 12668 invoked by uid 99); 28 Nov 2006 08:39:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Nov 2006 00:39:52 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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, 28 Nov 2006 00:39:42 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3AD537142F7 for ; Tue, 28 Nov 2006 00:39:22 -0800 (PST) Message-ID: <17278817.1164703162238.JavaMail.jira@brutus> Date: Tue, 28 Nov 2006 00:39:22 -0800 (PST) From: "Leo Li (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2340) [classlib][luni]ObjectInputStream.readClassDesc throws NullPointerException when it is called outside of readObject() In-Reply-To: <24396253.1164692301040.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 [ http://issues.apache.org/jira/browse/HARMONY-2340?page=all ] Leo Li updated HARMONY-2340: ---------------------------- Attachment: patch-2340.diff Will somebody try the patch? > [classlib][luni]ObjectInputStream.readClassDesc throws NullPointerException when it is called outside of readObject() > --------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2340 > URL: http://issues.apache.org/jira/browse/HARMONY-2340 > Project: Harmony > Issue Type: Bug > Reporter: Leo Li > Attachments: patch-2340.diff > > > Here is a testcase: > class ObjectOutputStreamWithWriteDesc extends ObjectOutputStream { > public ObjectOutputStreamWithWriteDesc(OutputStream os) throws IOException { > super(os); > } > public void writeClassDescriptor(ObjectStreamClass desc) throws IOException { > super.writeClassDescriptor(desc); > } > } > class ObjectIutputStreamWithReadDesc extends ObjectInputStream { > public ObjectIutputStreamWithReadDesc(InputStream is) throws IOException { > super(is); > ; > } > public ObjectStreamClass readClassDescriptor() throws IOException, > ClassNotFoundException { > return super.readClassDescriptor(); > } > } > class TestClassForSerialization implements Serializable { > } > public class TestReadClassDescriptor extends TestCase { > public void test_ClassDescriptor() throws IOException, > ClassNotFoundException { > File file = new File("temp.ser"); > file.deleteOnExit(); > ObjectOutputStreamWithWriteDesc oos = new ObjectOutputStreamWithWriteDesc( > new FileOutputStream(file)); > ObjectStreamClass objectStreamClass = ObjectStreamClass > .lookup(Integer.class); > oos.writeClassDescriptor(objectStreamClass); > oos.close(); > ObjectIutputStreamWithReadDesc ois = new ObjectIutputStreamWithReadDesc( > new FileInputStream(file)); > Object obj = ois.readClassDescriptor(); > ois.close(); > assertEquals(ObjectStreamClass.class, obj.getClass()); > } > } > RI passes. > Harmony fails. -- 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