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

unclear spec for BeanContextServiceRevokedEvent.isServiceClass

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.5



      Name: sdC67446 Date: 06/10/98


      The spec for method
      java.beans.beancontext.BeanContextServiceRevokedEvent(Class service)
      says nothing about method's behavior when class instance was create with
      serviceClass == null using constructor
      BeanContextServiceRevokedEvent(BeanContextServices, null, false).
      The doc says:

            public boolean isServiceClass(Class service)
            test service equality
            
      Currently in this case isServiceClass throws undocumented
      NullPointerException.

      -----Here is the test demonstrating the bug:------
      import java.beans.beancontext.*;

      public class Test {
          
          public static void main(String[] args) {
              BeanContextServicesSupport bcss = new BeanContextServicesSupport();
              BeanContextServiceRevokedEvent bcsre =
                  new BeanContextServiceRevokedEvent(bcss, null, false);

              if (bcsre.getClass() != null) {
                  System.out.println("input param != null.");
              }
              bcsre.isServiceClass(bcsre.getClass());
          }
      }
      -----Output from test:--------------------
      input param != null.
      Exception in thread "main" java.lang.NullPointerException
      at java.beans.beancontext.BeanContextServiceRevokedEvent.isServiceClass(Compiled Code)
      at Test.main(Compiled Code)
      -------------------------------------------------
      ======================================================================

            jhosunw Jamie Ho (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: