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

changed behavior for class BeanContextMembershipEvent

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: sdC67446 Date: 07/20/99


      The behavior of
          public BeanContextMembershipEvent(BeanContext bc, Object[] changes)
          public BeanContextMembershipEvent(BeanContext bc, Collection changes)
      of class java.beans.beancontext.BeanContextMembershipEvent
      in jdk1.3K has been changed.

      The test demonstrating the bug:
      -------------------------------------------------------------
      import java.beans.beancontext.*;
      import java.util.Collection;

      public class Test {

          public static void main(String[] args) {
              BeanContextMembershipEvent bcme = null;
              BeanContext bc = new BeanContextSupport();
              try {
                  bcme = new BeanContextMembershipEvent(bc, (Object[])null);
                  System.out.println("- 1 -");
              } catch (NullPointerException e) {
                  System.out.println(e);
              }
              try {
                  bcme = new BeanContextMembershipEvent(bc, (Collection)null);
                  System.out.println("- 2 -");
              } catch (NullPointerException e) {
                  System.out.println(e);
              }
          }
      }

      Output for Classic VM (build JDK-1.2-V, green threads, sunwjit)
      -------------------------------------------------------------
      - 1 -
      - 2 -

      Output for Classic VM (build JDK-1.3-L, green threads, nojit)
      -------------------------------------------------------------
      Warning: JIT compiler "sunwjit" not found. Will use interpreter.
      java.lang.NullPointerException: BeanContextMembershipEvent: changes is null.
      java.lang.NullPointerException: BeanContextMembershipEvent constructor: changes is null.

      -------------------------------------------------------------
      The spec for these constructors doesn't fully specify expected
      behavior if input parameter 'changes' == null.

      The doc says:
      -------------------------------------------------------------
      public BeanContextMembershipEvent(BeanContext bc,
                                        Collection changes)

           Contruct a BeanContextMembershipEvent
           Parameters:
               bc - The BeanContext source
               changes - The Children affected


      public BeanContextMembershipEvent(BeanContext bc,
                                        Object[] changes)

           Contruct a BeanContextMembershipEvent
           Parameters:
               bc - The BeanContext source
               changes - The Children effected
           Throws:
               NullPointerException - if changes associated with this event
               are null.
      ------------------------------------------------------------
      Thus the jck1.3 tests
      api/java/beans/beancontext/BeanContextMembershipEvent/index.html#Constructor
      api/java/beans/beancontext/BeanContextMembershipEvent/index.html#Other
      api/java/beans/beancontext/BeanContextMembershipEvent/index.html#Fields
      fail.

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

            Unassigned Unassigned
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: