You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Anton Ivanov (JIRA)" <ji...@apache.org> on 2006/12/06 12:39:21 UTC

[jira] Created: (HARMONY-2490) java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException (RI compatibility issue)

java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException (RI compatibility issue)
---------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2490
                 URL: http://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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2490) [classlib][beans] java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException (RI compatibility issue)

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Resolved: (HARMONY-2490) [classlib][beans] java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException (RI compatibility issue)

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-2490.
----------------------------------

    Resolution: Cannot Reproduce

This test case now passes on Harmony's implementation of Beans.

I've added your test case as a regression test at repo revision r598642.

Please verify.


> [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
>            Assignee: Tim Ellison
>            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.


[jira] Assigned: (HARMONY-2490) [classlib][beans] java.beans.DefaultPersistenceDelegate.initialize() does not throw NullPointerException (RI compatibility issue)

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-2490:
------------------------------------

    Assignee: Tim Ellison

> [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
>            Assignee: Tim Ellison
>            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.