harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-819) serialization: ObjectInputStream.readObject() doesn't throw expected exception after readUnshared()
Date Tue, 08 Aug 2006 15:44:17 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-819?page=comments#action_12426612 ] 
            
Anton Luht commented on HARMONY-819:
------------------------------------

fix verified with patch applied to

svn = r429665, (Aug  8 2006), Windows/ia32/msvc 1310, debug build


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