You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2007/01/09 14:47:27 UTC
[jira] Closed: (HARMONY-2402) [classlib][luni]
java.io.ObjectInputStream.registerValidation throws InvalidObjectException
while RI throws NotActiveException
[ https://issues.apache.org/jira/browse/HARMONY-2402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tim Ellison closed HARMONY-2402.
--------------------------------
Verified by Mikhail.
> [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