-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
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
======================================================================