JDK-4132698 : spec for ctor java.beans.beancontext.BeanContextMembershipEvent unclear
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.2.0
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1998-04-27
  • Updated: 1999-07-02
  • Resolved: 1999-07-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.3.0 betaFixed
Related Reports
Relates :  
Description

Name: sdC67446			Date: 04/27/98


The spec for ctor
java.beans.beancontext.BeanContextMembershipEvent(BeanContext bc,
Object[] changes) does not specify behavior if 'changes' == null.
Currently ctor doesn't check 'changes' for null.
After that method size() throws unexpected NullPointerException.

More acceptible behavior here is to throw NullPointerException
in ctor unless otherwise specified.
--------------Here is what doc says:--------------

BeanContextMembershipEvent

public BeanContextMembershipEvent(BeanContext bc,
                                  Object[] changes)

       Contruct a BeanContextMembershipEvent
       Parameters:
              bc - The BeanContext source 
              changes - The Children effected 

-----Here is the test demonstrating the bug:------

import java.beans.beancontext.*;

public class Test extends BeanContextMembershipEvent {

    public Test(BeanContext bc,Object[] objects) {
        super(bc,objects);
    }

    public static void main(String[] args) {

        BeanContextSupport bcs = new BeanContextSupport();
        Test bcme = new Test(bcs,null);

        try {
            System.out.println(bcme.size());
        } catch (Exception e) {
            System.out.println("-"+e);
        }
    }
}
-----Here is output from test:--------------------
-java.lang.NullPointerException
--------------------------------------------------
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: kestrel-beta FIXED IN: kestrel-beta INTEGRATED IN: kestrel-beta
14-06-2004

EVALUATION agreed larry.cable@Eng 1998-05-05
05-05-1998