-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.2.0
-
sparc
-
solaris_2.5
Name: avC70361 Date: 12/04/97
The getDeltas() and isDeltaMember(Object) methods of the
java.beans.beancontext.BeanContextMembershipEvent class throw
NullPointerException if an instance of the class the methods being called for
has been created with null as a value of the 'bcc' parameter of the
BeanContextMembershipEvent(BeanContext bc, Object[] bcc) constructor. Either
the methods should not throw NullPointerException, but should return 'null' and
'false', accordingly, or the constructor should throw NullPointerException when
invoked with null as a value of bcc variable.
Here is a test demonstrating the bug:
------------BeanContextmembershipEventTest.java-----------
import java.beans.beancontext.BeanContextMembershipEvent;
import java.beans.beancontext.BeanContextSupport;
import java.beans.beancontext.BeanContext;
public class BeanContextMembershipEventTest extends BeanContextMembershipEvent {
BeanContextMembershipEventTest(BeanContext bc, Object[] bcc) {
super(bc, bcc);
}
public static void main(String[] args) {
BeanContextMembershipEvent event = new BeanContextMembershipEventTest(new BeanContextSupport(), null);
try {
event.getDeltas();
} catch(Exception e) {
System.out.println("BeanContextMembershipEvent.getDeltas() : Unexpected exception " + e);
}
try {
event.isDeltaMember(new Object());
} catch(Exception e) {
System.out.println("BeanContextMembershipEvent.isDeltaMember(Object) : Unexpected exception " + e);
}
}
}
-----------------------------
-----------The test output:----------
#>java BeanContextMembershipEventTest
BeanContextMembershipEvent.getDeltas() : Unexpected exception java.lang.NullPointerException
BeanContextMembershipEvent.isDeltaMember(Object) : Unexpected exception java.lang.NullPointerException
-------------------------------------
======================================================================