You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/04/17 11:17:15 UTC
[jira] Updated: (HARMONY-2490) [classlib][beans]
java.beans.DefaultPersistenceDelegate.initialize() does not throw
NullPointerException (RI compatibility issue)
[ 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.