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

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

XMLWordPrintable

    • 1.2beta3
    • sparc
    • solaris_2.5
    • Verified



      Name: sdC67446 Date: 10/01/97



      Method iterator() returns Iterator filled with collection of BCSChildInfos instead of collection of children added into BeanContextSupport.

      Here is the JDK source code comments:
      --------------------------------------------------
       iterator

       public synchronized Iterator iterator()

            Returns:
                  the iterator


      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();
          bcs.add(new java.lang.Integer(666));
          java.util.Iterator iterator = bcs.iterator();
          if (!(iterator.next() instanceof java.lang.Integer)) {
            System.out.println("!(iterator.next() instanceof java.lang.Integer)");
          }
        }
      }
      ---------Output from the test---------------------
      !(iterator.next() instanceof java.lang.Integer)

      --------------------------------------------------
      ======================================================================

            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: