You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2006/08/11 14:56:14 UTC

[jira] Closed: (HARMONY-819) serialization: ObjectInputStream.readObject() doesn't throw expected exception after readUnshared()

     [ http://issues.apache.org/jira/browse/HARMONY-819?page=all ]

Tim Ellison closed HARMONY-819.
-------------------------------


Verified by Oleg.


> serialization: ObjectInputStream.readObject() doesn't throw expected exception after readUnshared()
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-819
>                 URL: http://issues.apache.org/jira/browse/HARMONY-819
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows XP professional
>            Reporter: Anton Luht
>         Assigned To: Tim Ellison
>            Priority: Minor
>         Attachments: harmony-819.patch
>
>
> Classlib + VM version 419914
> build: win_ia32_msvc_debug
> Spec says:
> readUnshared():
> Reads an "unshared" object from the ObjectInputStream. This method is identical to readObject, except that it prevents subsequent calls to readObject and readUnshared from returning additional references to the deserialized instance obtained via this call. Specifically: 
> - ...
> - If readUnshared returns successfully, then any subsequent attempts to deserialize back-references to the stream handle deserialized by readUnshared will cause an ObjectStreamException to be thrown. 
> The following code passes in RI and failes in Harmony. 
> import java.io.*;
> public class Test {
>  public static void main(String[] args) throws Throwable {
>    ByteArrayOutputStream baos = new ByteArrayOutputStream();
>    try {
>      ObjectOutputStream oos = new ObjectOutputStream(baos);
>      oos.writeObject("abc");
>      oos.writeObject("abc");
>      oos.close();
>      ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
>      ois.readUnshared();
>      ois.readObject();
>      ois.close();
>      System.err.println("FAILED");
>    } catch(ObjectStreamException e) {
>      System.err.println("PASSED");
>    }
>  }
> }

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