-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
None
-
b09
-
generic
-
generic
Constructor for java.awt.image.AreaAveragingScaleFilter class throws IllegalArgumentException when passed a zero value for a input parameter. Such behavior is not specified either in the member spec or in the package/class description.
---------
import java.awt.image.AreaAveragingScaleFilter;
public class Test1 {
public static void main(String[] args) {
int[] values = { 1, -1, Integer.MAX_VALUE, Integer.MIN_VALUE,
29, 180, -32, -439 };
StubFilter filter = null;
for (int i = 0; i < values.length; i++) {
try {
filter = new StubFilter(0, values[i]);
System.out.println("result: false");
} catch (IllegalArgumentException e) {
System.out.println("result (iae): true");
}
}
}
public static class StubFilter extends AreaAveragingScaleFilter {
public StubFilter(int width, int height) {
super(width, height);
}
public int getSrcWidth() {
return srcWidth;
}
public int getSrcHeight() {
return srcHeight;
}
public int getDestWidth() {
return destWidth;
}
public int getDestHeight() {
return destHeight;
}
}
}
###@###.### 2004-12-21 14:42:51 GMT
---------
import java.awt.image.AreaAveragingScaleFilter;
public class Test1 {
public static void main(String[] args) {
int[] values = { 1, -1, Integer.MAX_VALUE, Integer.MIN_VALUE,
29, 180, -32, -439 };
StubFilter filter = null;
for (int i = 0; i < values.length; i++) {
try {
filter = new StubFilter(0, values[i]);
System.out.println("result: false");
} catch (IllegalArgumentException e) {
System.out.println("result (iae): true");
}
}
}
public static class StubFilter extends AreaAveragingScaleFilter {
public StubFilter(int width, int height) {
super(width, height);
}
public int getSrcWidth() {
return srcWidth;
}
public int getSrcHeight() {
return srcHeight;
}
public int getDestWidth() {
return destWidth;
}
public int getDestHeight() {
return destHeight;
}
}
}
###@###.### 2004-12-21 14:42:51 GMT
- csr for
-
JDK-8261307 AreaAveragingScaleFilter(int, int): IAE is not specified
-
- Closed
-