-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5
Name: sdC67446 Date: 06/08/98
The spec for method
java.beans.beancontext.BeanContextSupport.add(Object targetChild)
does not specify behavior if 'targetChild' == null.
Currently method throws unexpected IllegalArgumentException.
More convenient behavior here is to throw NullPointerException
or else it should be figured in spec.
--------------The doc says:--------------
public boolean add(Object targetChild)
Adds/nests a child within this BeanContext
Invoked as a side effect of java.beans.Beans.instantiate().
Parameters:
targetChildren - The child objects to nest within this BeanContext
-----Here is the test demonstrating the bug:------
import java.beans.beancontext.*;
import java.beans.*;
public class Test {
public static void main(String[] args) {
BeanContextSupport bcs = new BeanContextSupport();
try {
bcs.add(null);
} catch (Exception e) {
System.out.println(e);
}
}
}
-----Output from test:--------------------
java.lang.IllegalArgumentException
--------------------------------------------------
======================================================================
Name: sdC67446 Date: 06/09/98
Also the spec for method
java.beans.beancontext.BeanContextSupport.remove(Object targetChild)
does not specify behavior if 'targetChild' == null.
Currently remove(null) throws unexpected IllegalArgumentException too.
------The doc for remove says:-----------
public boolean remove(Object targetChild)
Parameters:
targetChildren - The child objects to remove
-----------------------------------------
======================================================================
The spec for method
java.beans.beancontext.BeanContextSupport.add(Object targetChild)
does not specify behavior if 'targetChild' == null.
Currently method throws unexpected IllegalArgumentException.
More convenient behavior here is to throw NullPointerException
or else it should be figured in spec.
--------------The doc says:--------------
public boolean add(Object targetChild)
Adds/nests a child within this BeanContext
Invoked as a side effect of java.beans.Beans.instantiate().
Parameters:
targetChildren - The child objects to nest within this BeanContext
-----Here is the test demonstrating the bug:------
import java.beans.beancontext.*;
import java.beans.*;
public class Test {
public static void main(String[] args) {
BeanContextSupport bcs = new BeanContextSupport();
try {
bcs.add(null);
} catch (Exception e) {
System.out.println(e);
}
}
}
-----Output from test:--------------------
java.lang.IllegalArgumentException
--------------------------------------------------
======================================================================
Name: sdC67446 Date: 06/09/98
Also the spec for method
java.beans.beancontext.BeanContextSupport.remove(Object targetChild)
does not specify behavior if 'targetChild' == null.
Currently remove(null) throws unexpected IllegalArgumentException too.
------The doc for remove says:-----------
public boolean remove(Object targetChild)
Parameters:
targetChildren - The child objects to remove
-----------------------------------------
======================================================================