harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-1429) Stream-based replacement does not work in ObjectOutputStream
Date Fri, 22 Sep 2006 07:09:26 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1429?page=all ]

Paulex Yang closed HARMONY-1429.
--------------------------------


Verified by Mikhail.

> Stream-based replacement does not work in ObjectOutputStream
> ------------------------------------------------------------
>
>                 Key: HARMONY-1429
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1429
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Win XP
>            Reporter: Mikhail Markov
>         Assigned To: Paulex Yang
>            Priority: Critical
>         Attachments: ObjectOutputStream.patch, ObjectOutputStreamTest.patch
>
>
> Patch for JIRA HARMONY-851 broke stream-based replacement mechanism in ObjectOutputStream.
This brokes normal RMI work as it uses this mechanism.
> For example, the following test fails on Harmony and pass on RI:
> import java.io.ByteArrayOutputStream;
> import java.io.IOException;
> import java.io.NotSerializableException;
> import java.io.ObjectOutputStream;
> import java.io.OutputStream;
> ============== Test.java ================= 
> public class Test {
>     public static void main(String[] args) throws Exception {
>         try {
>             ObjectOutputStream out = new TestObjectOutputStream(new ByteArrayOutputStream());
>             out.writeObject(new NotSerializable());
>         } catch (NotSerializableException e) {
>         }
>     }
>     private static class TestObjectOutputStream extends ObjectOutputStream {
>         public TestObjectOutputStream(OutputStream out) throws IOException {
>             super(out);
>             enableReplaceObject(true);
>         }
>         protected Object replaceObject(Object obj) throws IOException {
>             if (obj instanceof NotSerializable) {
>                 System.out.println("replaceObject called: obj = " + obj);
>             }
>             return obj;
>         }
>     }
>     private static class NotSerializable {
>     }
> }
> ====================================== 
> Output on RI:
> replaceObject called: obj = Test$NotSerializable@1b3d3e
> Output on Harmony is empty (replaceObject is not called).

-- 
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