You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Leo Li (JIRA)" <ji...@apache.org> on 2006/11/28 04:57:22 UTC

[jira] Commented: (HARMONY-2249) [classlib][luni]ObjectInputStream.readObject throws NullPointerException while readClassDescriptor has been overriden

    [ http://issues.apache.org/jira/browse/HARMONY-2249?page=comments#action_12453790 ] 
            
Leo Li commented on HARMONY-2249:
---------------------------------

Thank you. Verified.

> [classlib][luni]ObjectInputStream.readObject throws NullPointerException while readClassDescriptor has been overriden
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2249
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2249
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Leo Li
>         Assigned To: Richard Liang
>         Attachments: patch-2249.diff, patch-2249.diff
>
>
> Here is the testcase:
> public class SerTest3 extends TestCase {
>      
>        public static class ObjectOutputStreamWithWriteDesc extends
>             ObjectOutputStream {
>         public ObjectOutputStreamWithWriteDesc(OutputStream os)
>                 throws IOException {
>             super(os);
>         }
>         public void writeClassDescriptor(ObjectStreamClass desc)
>                 throws IOException {
>         }
>     }
>     public static class ObjectIutputStreamWithReadDesc extends
>             ObjectInputStream {
>         public ObjectIutputStreamWithReadDesc(InputStream is)
>                 throws IOException {
>             super(is);
>         }
>         public ObjectStreamClass readClassDescriptor() {
>             return ObjectStreamClass.lookup(Integer.class);
>         }
>     }
>     public void test_ClassDescriptor() throws IOException,
>             ClassNotFoundException {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         ObjectOutputStreamWithWriteDesc oos = new ObjectOutputStreamWithWriteDesc(
>                 baos);
>         oos.writeObject(int.class);
>         oos.flush();
>         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
>         ObjectIutputStreamWithReadDesc ois = new ObjectIutputStreamWithReadDesc(
>                 bais);
>         Object obj = ois.readObject();
>         oos.close();
>         ois.close();
>     }
> }
> 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