Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4080989

java.beans.beancontext.BeanContextSupport.contains() works wrong

XMLWordPrintable

    • 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.
      --------------------------------------------------

      ======================================================================

            lcablesunw Larry Cable (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: