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] Created: (HARMONY-2249) [classlib][luni]ObjectInputStream.readObject throws NullPointerException while readClassDescriptor has been overriden
Date Tue, 21 Nov 2006 09:53:02 GMT
[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


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