-
Bug
-
Resolution: Fixed
-
P5
-
1.2.0
-
beta
-
sparc
-
solaris_2.5
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
--------------------------------------------------
======================================================================
- relates to
-
JDK-6582164 JavaBeans tests should be open source
- Resolved