harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3916) [classlib][io] Harmony throws unexpected NotActiveException when there's a ObjectInputValidation registered
Date Sun, 20 May 2007 22:34:16 GMT
[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


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.


Mime
View raw message