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

some methods of ImageIO do not throw IllegalArgumentException

    XMLWordPrintable

    Details

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

      Description



      Name: ipR10067 Date: 05/29/2001



      The descriptions of static methods
      getImageReadersByFormatName, getImageReadersByMIMEType, getImageReadersBySuffix,
      getImageWritersByFormatName, getImageWritersByMIMEType, getImageWritersBySuffix
      of javax.imageio.ImageIO read that IllegalArgumentException will be thrown
      if parameter is null.

      But they do not throw IllegalArgumentException as expected:
      ---------------------------- source --------------------------------
      import javax.imageio.ImageIO;
      import java.util.Iterator;

      public class Tests {

          public static void main(String argv[]) {

              System.out.println("--- getImageReadersByFormatName ---");
              try {
                  Iterator readers = ImageIO.getImageReadersByFormatName(null);
              } catch (IllegalArgumentException iae) {
                  System.out.println("Expected " + iae.toString());
              }

              System.out.println("--- getImageReadersByMIMEType ---");
              try {
                  Iterator readers = ImageIO.getImageReadersByMIMEType(null);
              } catch (IllegalArgumentException iae) {
                  System.out.println("Expected " + iae.toString());
              }
              
              System.out.println("--- getImageReadersBySuffix ---");
              try {
                  Iterator readers = ImageIO.getImageReadersBySuffix(null);
              } catch (IllegalArgumentException iae) {
                  System.out.println("Expected " + iae.toString());
              }

              System.out.println("--- getImageWritersByFormatName ---");
              try {
                  Iterator writers = ImageIO.getImageWritersByFormatName(null);
              } catch (IllegalArgumentException iae) {
                  System.out.println("Expected " + iae.toString());
              }

              System.out.println("--- getImageWritersByMIMEType ---");
              try {
                  Iterator writers = ImageIO.getImageWritersByMIMEType(null);
              } catch (IllegalArgumentException iae) {
                  System.out.println("Expected " + iae.toString());
              }

              System.out.println("--- getImageWritersBySuffix ---");
              try {
                  Iterator writers = ImageIO.getImageWritersBySuffix(null);
              } catch (IllegalArgumentException iae) {
                  System.out.println("Expected " + iae.toString());
              }

          }

      }

      ---------------------------- 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 Tests
      --- getImageReadersByFormatName ---
      --- getImageReadersByMIMEType ---
      --- getImageReadersBySuffix ---
      --- getImageWritersByFormatName ---
      --- getImageWritersByMIMEType ---
      --- getImageWritersBySuffix ---



      This bug affects new API tests
       tests/api/javax_imageio/ImageIO/index.html#getImageReadersByFormatName
       tests/api/javax_imageio/ImageIO/index.html#getImageReadersByMIMEType
       tests/api/javax_imageio/ImageIO/index.html#getImageReadersBySuffix
       tests/api/javax_imageio/ImageIO/index.html#getImageWritersByFormatName
       tests/api/javax_imageio/ImageIO/index.html#getImageWritersByMIMEType
       tests/api/javax_imageio/ImageIO/index.html#getImageWritersBySuffix


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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: