-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2beta3
-
sparc
-
solaris_2.5
-
Verified
Name: sdC67446 Date: 09/22/97
The java.beans.beancontext.BeanContextSupport.toArray() returns an array of children's BCSChildInfo instead of array of children.
Here is the JDK Specification:
--------------------------------------------------
toArray
public synchronized Object[] toArray()
Returns:
an array of children
Here is the test demonstrating the bug:
-----------------Test.java------------------------
import java.beans.beancontext.BeanContextSupport;
public class Test {
public static void main(String[] args) {
BeanContextSupport bcs = new BeanContextSupport();
Object obj = new java.lang.Integer(666);
bcs.add(obj);
if (
(bcs.toArray().length == 1) &&
(!bcs.toArray()[0].equals(obj))
) {
System.out.println("Abnormal situation.");
}
}
}
---------Output from the test---------------------
Abnomal situation.
--------------------------------------------------
======================================================================