harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-2340) [classlib][luni]ObjectInputStream.readClassDesc throws NullPointerException when it is called outside of readObject()
Date Thu, 30 Nov 2006 02:17:22 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2340?page=all ]

Richard Liang reassigned HARMONY-2340:
--------------------------------------

    Assignee: Richard Liang

> [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
>         Assigned To: Richard Liang
>         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

        

Mime
View raw message