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/20 08:23:02 UTC

[jira] Created: (HARMONY-2239) [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class

[classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class
------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2239
                 URL: http://issues.apache.org/jira/browse/HARMONY-2239
             Project: Harmony
          Issue Type: Bug
            Reporter: Leo Li


Here is the testcase:
public class SerTest extends TestCase {

    private static class TestSerializable implements Serializable{
       
        protected Object writeReplace() throws ObjectStreamException {
           return int.class;           
        }
    }
    
    private static class ObjectOutputStreamWithReplace extends ObjectOutputStream {
        public ObjectOutputStreamWithReplace(OutputStream out)
                throws IOException {
            super(out);          
            enableReplaceObject(true);
        }

        protected Object replaceObject(Object obj) throws IOException {
            System.out.println("replaceObject");
        	return new Double(20);
        }
    }
    
    public void test_replaceObject() throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStreamWithReplace oos = new ObjectOutputStreamWithReplace(baos);

        oos.writeObject(new TestSerializable());
        oos.flush();
        ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
        Object obj = ois.readObject();
        oos.close();
        ois.close();
        
        assertTrue("replaceObject has not been called", (obj instanceof Double));
    }
}

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

        

[jira] Resolved: (HARMONY-2239) [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2239?page=all ]

Paulex Yang resolved HARMONY-2239.
----------------------------------

    Resolution: Fixed

Leo, patch applied at revision r477748,  thanks a lot for this enhancement, please verify that the problem is fully fixed as you expected.


> [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2239
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2239
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Assigned To: Paulex Yang
>         Attachments: patch-2239.diff
>
>
> Here is the testcase:
> public class SerTest extends TestCase {
>     private static class TestSerializable implements Serializable{
>        
>         protected Object writeReplace() throws ObjectStreamException {
>            return int.class;           
>         }
>     }
>     
>     private static class ObjectOutputStreamWithReplace extends ObjectOutputStream {
>         public ObjectOutputStreamWithReplace(OutputStream out)
>                 throws IOException {
>             super(out);          
>             enableReplaceObject(true);
>         }
>         protected Object replaceObject(Object obj) throws IOException {
>             System.out.println("replaceObject");
>         	return new Double(20);
>         }
>     }
>     
>     public void test_replaceObject() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         ObjectOutputStreamWithReplace oos = new ObjectOutputStreamWithReplace(baos);
>         oos.writeObject(new TestSerializable());
>         oos.flush();
>         ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
>         Object obj = ois.readObject();
>         oos.close();
>         ois.close();
>         
>         assertTrue("replaceObject has not been called", (obj instanceof Double));
>     }
> }
> 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

        

[jira] Updated: (HARMONY-2239) [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2239?page=all ]

Leo Li updated HARMONY-2239:
----------------------------

    Attachment: patch-2239.diff

Hi,  will somebody try this?

> [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2239
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2239
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Attachments: patch-2239.diff
>
>
> Here is the testcase:
> public class SerTest extends TestCase {
>     private static class TestSerializable implements Serializable{
>        
>         protected Object writeReplace() throws ObjectStreamException {
>            return int.class;           
>         }
>     }
>     
>     private static class ObjectOutputStreamWithReplace extends ObjectOutputStream {
>         public ObjectOutputStreamWithReplace(OutputStream out)
>                 throws IOException {
>             super(out);          
>             enableReplaceObject(true);
>         }
>         protected Object replaceObject(Object obj) throws IOException {
>             System.out.println("replaceObject");
>         	return new Double(20);
>         }
>     }
>     
>     public void test_replaceObject() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         ObjectOutputStreamWithReplace oos = new ObjectOutputStreamWithReplace(baos);
>         oos.writeObject(new TestSerializable());
>         oos.flush();
>         ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
>         Object obj = ois.readObject();
>         oos.close();
>         ois.close();
>         
>         assertTrue("replaceObject has not been called", (obj instanceof Double));
>     }
> }
> 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

        

[jira] Assigned: (HARMONY-2239) [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2239?page=all ]

Paulex Yang reassigned HARMONY-2239:
------------------------------------

    Assignee: Paulex Yang

> [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2239
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2239
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Assigned To: Paulex Yang
>         Attachments: patch-2239.diff
>
>
> Here is the testcase:
> public class SerTest extends TestCase {
>     private static class TestSerializable implements Serializable{
>        
>         protected Object writeReplace() throws ObjectStreamException {
>            return int.class;           
>         }
>     }
>     
>     private static class ObjectOutputStreamWithReplace extends ObjectOutputStream {
>         public ObjectOutputStreamWithReplace(OutputStream out)
>                 throws IOException {
>             super(out);          
>             enableReplaceObject(true);
>         }
>         protected Object replaceObject(Object obj) throws IOException {
>             System.out.println("replaceObject");
>         	return new Double(20);
>         }
>     }
>     
>     public void test_replaceObject() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         ObjectOutputStreamWithReplace oos = new ObjectOutputStreamWithReplace(baos);
>         oos.writeObject(new TestSerializable());
>         oos.flush();
>         ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
>         Object obj = ois.readObject();
>         oos.close();
>         ois.close();
>         
>         assertTrue("replaceObject has not been called", (obj instanceof Double));
>     }
> }
> 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

        

[jira] Commented: (HARMONY-2239) [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2239?page=comments#action_12452384 ] 
            
Leo Li commented on HARMONY-2239:
---------------------------------

Fixed. Thank you.

> [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2239
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2239
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Assigned To: Paulex Yang
>         Attachments: patch-2239.diff
>
>
> Here is the testcase:
> public class SerTest extends TestCase {
>     private static class TestSerializable implements Serializable{
>        
>         protected Object writeReplace() throws ObjectStreamException {
>            return int.class;           
>         }
>     }
>     
>     private static class ObjectOutputStreamWithReplace extends ObjectOutputStream {
>         public ObjectOutputStreamWithReplace(OutputStream out)
>                 throws IOException {
>             super(out);          
>             enableReplaceObject(true);
>         }
>         protected Object replaceObject(Object obj) throws IOException {
>             System.out.println("replaceObject");
>         	return new Double(20);
>         }
>     }
>     
>     public void test_replaceObject() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         ObjectOutputStreamWithReplace oos = new ObjectOutputStreamWithReplace(baos);
>         oos.writeObject(new TestSerializable());
>         oos.flush();
>         ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
>         Object obj = ois.readObject();
>         oos.close();
>         ois.close();
>         
>         assertTrue("replaceObject has not been called", (obj instanceof Double));
>     }
> }
> 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

        

[jira] Closed: (HARMONY-2239) [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class

Posted by "Leo Li (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leo Li closed HARMONY-2239.
---------------------------


> [classlib][luni]ObjectOutputStream fails to call ReplaceObject while the serialized class is int.class
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2239
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2239
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Leo Li
>         Assigned To: Paulex Yang
>         Attachments: patch-2239.diff
>
>
> Here is the testcase:
> public class SerTest extends TestCase {
>     private static class TestSerializable implements Serializable{
>        
>         protected Object writeReplace() throws ObjectStreamException {
>            return int.class;           
>         }
>     }
>     
>     private static class ObjectOutputStreamWithReplace extends ObjectOutputStream {
>         public ObjectOutputStreamWithReplace(OutputStream out)
>                 throws IOException {
>             super(out);          
>             enableReplaceObject(true);
>         }
>         protected Object replaceObject(Object obj) throws IOException {
>             System.out.println("replaceObject");
>         	return new Double(20);
>         }
>     }
>     
>     public void test_replaceObject() throws Exception {
>         ByteArrayOutputStream baos = new ByteArrayOutputStream();
>         ObjectOutputStreamWithReplace oos = new ObjectOutputStreamWithReplace(baos);
>         oos.writeObject(new TestSerializable());
>         oos.flush();
>         ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream (baos.toByteArray()));
>         Object obj = ois.readObject();
>         oos.close();
>         ois.close();
>         
>         assertTrue("replaceObject has not been called", (obj instanceof Double));
>     }
> }
> RI passes.
> Harmony fails.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.