Method "contains" of ServiceRegistry throws unspecified exception

XMLWordPrintable

    • beta2
    • generic
    • generic



      Name: ipR10067 Date: 06/03/2001



      The description of method "contains" of class javax.imageio.spi.ServiceRegistry
      says nothing about throwing NullPointerException,
      but if argument "provider" is null it will be thrown.

      To reproduce the problem run the following test:
      ---------------------------- source --------------------------------
      import javax.imageio.spi.ServiceRegistry;
      import javax.imageio.spi.IIORegistry;

      public class Test {

          public static void main(String argv[]) {
       
              boolean result;
              
              ServiceRegistry SR = IIORegistry.getDefaultInstance(); ;
              try {
                  result = SR.contains(null);
                  System.out.println("Result = " + result + " (should be false)");
              } catch (Throwable ex) {
                  System.out.println ("Unexpected exception " + ex.toString());
              }
              return;
          }
      }
      ---------------------------- log --------------------------------
      >java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
      >java Test
      Unexpected exception java.lang.NullPointerException


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

            Assignee:
            Daniel Rice (Inactive)
            Reporter:
            Ip Ip (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: