harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Li (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2249) [classlib][luni]ObjectInputStream.readObject throws NullPointerException while readClassDescriptor has been overriden
Date Tue, 28 Nov 2006 03:57:22 GMT
    [ 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

        

Mime
View raw message