harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-819) serialization: ObjectInputStream.readObject() doesn't throw expected exception after readUnshared()
Date Tue, 08 Aug 2006 21:16:14 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-819?page=all ]

Tim Ellison reassigned HARMONY-819:
-----------------------------------

    Assignee: Tim Ellison

> 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

        

Mime
View raw message