harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2490) [classlib][beans] java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException (RI compatibility issue)
Date Tue, 17 Apr 2007 09:17:15 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexey Petrenko updated HARMONY-2490:
-------------------------------------

    Summary: [classlib][beans] java.beans.DefaultPersistenceDelegate.initialize() does not
throw NullPointerException (RI compatibility issue)  (was: java.beans.DefaultPersistenceDelegate.initialize()
does not throw NullPointerException (RI compatibility issue))

> [classlib][beans] java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException
(RI compatibility issue)
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2490
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2490
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>            Priority: Trivial
>
> NullPointerException is not thrown for initialize(Class<?> type, Object oldInstance,
> Object newInstance, Encoder out) if oldInstance == null while RI throws NullPointerException.
> It is not explicitly specified that NullPointerException should be thrown in such a case,
however it is written in specification for java.beans package:
> "Unless explicitly stated, null values or empty Strings are not valid parameters for
the methods in this package. You may expect to see exceptions if these parameters are used"
> This is a compatibility issue.
> The test to reproduce the problem:
> import junit.framework.TestCase;
> import java.beans.*;
> public class InitializeTest extends TestCase {     
>    public void test1 () {  
>        try {  
>            testDefaultPersistenceDelegate obj 
>                    = new testDefaultPersistenceDelegate();
>            obj.initialize(Object.class, null, new Object(), new Encoder());  
>            fail("NullPointerException should be thrown");               
>        } catch (NullPointerException e) {
>            //expected
>        } 
>     }  
> }
> class testDefaultPersistenceDelegate extends DefaultPersistenceDelegate  {
>     testDefaultPersistenceDelegate() {
>       super();
>    }
>    public void initialize(Class type, Object oldInstance, Object newInstance, Encoder
out)    {
>        super.initialize(type,oldInstance, newInstance,out);
>    }
> }

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