-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta2
-
generic
-
generic
Name: ooR10006 Date: 04/03/2001
The spec for constructor javax.print.attribute.standard.PageRanges(int[][] members)
says:
"Throws:
NullPointerException - (unchecked exception) Thrown if members is null or any
element of members is null."
But in Merlin b58 API implementation of PageRanges((int[][])null)
throws IllegalArgumentException.
The following test shows this:
import javax.print.attribute.standard.PageRanges;
public class Test {
public static void main(String[] args){
try {
int[][] m = null;
PageRanges pr = new PageRanges(m);
System.out.println("wrong: no exceptions, NullPointerException expected");
} catch (NullPointerException e){
System.out.println("OKAY");
} catch (IllegalArgumentException ie){
System.out.println("wrong: IllegalArgumentException");
}
}
}
The error is in JDK1.4 source code of PageRanges(int[][] members) constructor:
public PageRanges(int[][] members) {
super (members);
if (members == null) {
throw new IllegalArgumentException("members is null");
}
...
======================================================================