You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Zhang (JIRA)" <ji...@apache.org> on 2007/05/22 13:25:16 UTC
[jira] Commented: (HARMONY-3916) [classlib][io] Harmony throws
unexpected NotActiveException when there's a ObjectInputValidation
registered
[ https://issues.apache.org/jira/browse/HARMONY-3916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497822 ]
Andrew Zhang commented on HARMONY-3916:
---------------------------------------
Thanks Alexei,
It looks fine. :)
> [classlib][io] Harmony throws unexpected NotActiveException when there's a ObjectInputValidation registered
> ------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-3916
> URL: https://issues.apache.org/jira/browse/HARMONY-3916
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assigned To: Alexei Zakharov
> Attachments: Harmony-3916.diff
>
>
> Following test case reproduces the problem:
> public void test() throws Exception {
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> ObjectOutputStream oos = new ObjectOutputStream(baos);
> oos.writeObject(new RegisterValidationClass());
> oos.close();
> ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
> ObjectInputStream fis = new ObjectInputStream(bais);
> // should not throw NotActiveException
> fis.readObject();
> }
>
> private static class RegisterValidationClass implements Serializable {
> private A a = new A();
> private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
> stream.defaultReadObject();
> stream.registerValidation(new MockObjectInputValidation(), 0);
> }
> }
>
> private static class MockObjectInputValidation implements ObjectInputValidation {
> public void validateObject() throws InvalidObjectException {
>
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.