-
Bug
-
Resolution: Fixed
-
P2
-
1.2.0
-
1.2beta2
-
sparc
-
solaris_2.5
-
Verified
Name: sdC67446 Date: 09/22/97
The java.beans.beancontext.BeanContextSupport.contains() works wrong.
Here is the JDK Specification:
--------------------------------------------------
contains
public synchronized boolean contains(Object o)
Returns:
if this object is a child
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 object = new Object();
if (bcs.contains(object)) {
System.out.println("1st mistake.");
}
bcs.add(object);
if (!bcs.contains(object)) {
System.out.println("2nd mistake.");
}
}
}
---------Output from the test---------------------
1st mistake.
2nd mistake.
--------------------------------------------------
======================================================================