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

FileImageInputStream(RandomAccessFile raf) does not throw IAE when raf is null

XMLWordPrintable

    • beta2
    • generic
    • generic



      Name: mlR10151 Date: 04/10/2001



      According to the spec.
      public FileImageInputStream(RandomAccessFile raf)
       . . .
      Throws:
                  IllegalArgumentException - if raf is null.

      But it does not throw any exception:

      ===================== a.java =======================
      import java.io.*;
      import javax.imageio.stream.*;

      public class a {
          public static void main (String argv[]) throws Exception {
              RandomAccessFile f = null;
              try {
                  new FileImageInputStream(f);
                  System.out.println("Failed");
              } catch (IllegalArgumentException e) {
                  System.out.println("Passed");
              }
          }
      }
      ===================== log =======================
      % java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b59)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b59, mixed mode)
      % java a
      Failed



      This bug causes failure of the new JCK test
      api/javax_imageio/stream/FileImageInputStream/index.html#Ctor


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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: