harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2402) [classlib][luni] java.io.ObjectInputStream.registerValidation throws InvalidObjectException while RI throws NotActiveException
Date Tue, 09 Jan 2007 13:15:27 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463271
] 

Mikhail Markov commented on HARMONY-2402:
-----------------------------------------

Yes, Tim - sure your modification is much more readable. Thanks for doing this!
Now test works as expected.

> [classlib][luni] java.io.ObjectInputStream.registerValidation throws InvalidObjectException
while RI throws NotActiveException
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2402
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2402
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Artem Aliev
>         Assigned To: Tim Ellison
>            Priority: Minor
>         Attachments: H-2402.patch
>
>
> java.io.ObjectInputStream.registerValidation throws InvalidObjectException
> while RI throws NotActiveException.
> Harmony checks first parameter and if ObjectInputValidation obj == null -
> throws InvalidObjectException.
> RI throws java.io.NotActiveException: stream inactive.
> Looks like a bug in RI because according to the specification
> method must throw InvalidObjectException if  the validation object is null.
> Test for reproducing:
> import junit.framework.TestCase;
> import java.io.*;
> public class test extends TestCase {      
>     public void test1 () { 
>         ObjectInputStream obj=null; 
>         try {           
>             ByteArrayOutputStream byteArrayOutputStream = new
> ByteArrayOutputStream();
>             new ObjectOutputStream(byteArrayOutputStream);
>             obj = new ObjectInputStream(new
> ByteArrayInputStream(byteArrayOutputStream.toByteArray()));
>         } catch (IOException e) {
>             fail("unexpected IOException");
>         }
>         try {           
>             obj.registerValidation(null,256);           
>             fail("NotActiveException should be thrown");   
>         } catch (NotActiveException e) {
>             //expected
>         } catch (InvalidObjectException e) {
>             fail("NotActiveException should be thrown");
>         }
>     }     
> }
> Output on Sun 1.5:
> ==================
> .F
> Time: 0
> There was 1 failure:
> 1) test1(test)junit.framework.AssertionFailedError: InvalidObjectException
> should be thrown
>         at test.test1(test.java:20)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> FAILURES!!!
> Tests run: 1,  Failures: 1,  Errors: 0
> Output on Harmony:
> ==================
> .
> Time: 0.079
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message