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

ImageTypeSpecifier: no IllegalArgumentException if parameter is null

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: bkR10012 Date: 03/26/2001



      According to the spec. ImageTypeSpecifier constructors should throw
      IllegalArgumentException if either parameter is null.
      But they do not throw IllegalArgumentException as expected.

      See test source and log below.
      ---------------------------------------- test.java
      package test;

      import javax.imageio.ImageTypeSpecifier;

      public class test {

          public static void main(String argv[]) {

              try {
                  ImageTypeSpecifier itspecifier = new ImageTypeSpecifier( null,
      null);
                  System.out.println("Ctor1 failed");
              } catch( IllegalArgumentException e ) {
                  System.out.println("Ctor1 passed");
              } catch( Throwable ee ) {
                  System.out.println("Ctor1: unexpected "+ ee);
              }
              try {
                  ImageTypeSpecifier itspecifier = new ImageTypeSpecifier(null);
                  System.out.println("Ctor2 failed");
              } catch( IllegalArgumentException e ) {
                  System.out.println("Ctor2 passed");
              } catch( Throwable ee ) {
                  System.out.println("Ctor2: unexpected "+ ee);
              }
          }
      }
      ----------------------------------------
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b56)
      Java HotSpot(TM) Client VM (build 1.4-beta-B56, mixed mode)
      % java test.test
      Ctor1 failed
      Ctor2: unexpected java.lang.NullPointerException
      ----------------------------------------
      ======================================================================

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: