-
Type:
CSR
-
Resolution: Approved
-
Priority:
P3
-
Component/s: client-libs
-
None
-
behavioral
-
low
-
-
Java API
-
SE
Summary
The behavior and specification of the java.awt.image.Kernel(..) constructor is updated to document exceptions and the conditions under which they may be thrown.
Problem
java.awt.image.Kernel(..) constructor does not validate the width and height input arguments and throw appropriate exceptions. NullPointerException is currently thrown for null data, but this is not specified.
Solution
Add explicit checks for invalid arguments and throw appropriate exceptions, and update the specification to document this.
Specification
class java.awt.image.Kernel
* @param data kernel data in row major order
+ * @throws IllegalArgumentException if {@code data} is null
+ * @throws IllegalArgumentException if {@code width} or {@code height}
+ * is not positive
+ * @throws IllegalArgumentException if product of {@code width} and
+ * {@code height} overflows an int
* @throws IllegalArgumentException if the length of {@code data}
* is less than the product of {@code width} and
* {@code height}
*/
public Kernel(int width, int height, float[] data) ;
- csr of
-
JDK-8368729 Add appropriate checks in java.awt.image.Kernel constructor
-
- Resolved
-