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

spec: method ImageIO.getImageWriters description is incomplete

XMLWordPrintable

    • beta2
    • generic
    • generic



      Name: ipR10067 Date: 04/02/2001



      The API specification for method ImageIO.getImageWriters
      looks incomplete. The method's behaviour is not specified
      for erroneous parameters.

      The section "Throws" describes exception for one non-existent
      parameter "image" only.
      It seems to be "copy-paste" typo.

      "public static Iterator getImageWriters(ImageTypeSpecifier type, String formatName)
        ...
        Throws: IllegalArgumentException - if image is null."


      Actually, JDK (build 1.4.0-beta-b58) does not throw exceptions
      even when both parameters are null.

      The example below demonstrates this behaviour:

      -----------------getImageWriters.java----------------

      import javax.imageio.ImageIO;
      import javax.imageio.ImageWriter;
      import java.util.Iterator;

      public class getImageWriters {
          public static void main(String argv[]) {
              try {
                   Iterator writers = ImageIO.getImageWriters(null, null);
                   System.out.println("No exception was thrown");
              } catch (Throwable iae) {
                System.out.println("exception is " + iae.toString());
              }
          }
      }

      --------------------log---------------------------
      >java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b58)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b58, mixed mode)
      >javac getImageWriters.java
      >java getImageWriters
      No exception was thrown


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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: