-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
behavioral
-
low
-
-
Java API
-
SE
Summary
The specifications of Raster.createPackedRaster(..) factory methods is updated to document exceptions and the conditions under which they may be thrown.
Problem
These Raster.createPackedRaster(..) methods do not document all the conditions under which they may throw exceptions. Also two other methods need to be updated.
Solution
Update the specification - and ensure that the implementation matches the updated specification.
Specification
class java.awt.image.Raster
+ * @throws IllegalArgumentException if {@code w * pixelStride} is greater + * than {@code scanlineStride} + * @throws IllegalArgumentException if the data size need to store all + * lines of the image is greater than {@code Integer.MAX_VALUE} */ public static WritableRaster createInterleavedRaster(int dataType, int w, int h, int scanlineStride, int[] bandOffsets, Point location) + * @throws IllegalArgumentException if the data size need to store all + * lines of a bank of the image is greater than {@code Integer.MAX_VALUE} */ public static WritableRaster createBandedRaster(int dataType, int w, int h, int scanlineStride, int[] bankIndices, int[] bandOffsets, Point location) - * @throws RasterFormatException if {@code w} or {@code h} - * is less than or equal to zero, or computing either + * @throws NullPointerException if {@code bandMasks} is null + * @throws IllegalArgumentException if {@code w} and {@code h} + * are not both greater than 0 + * @throws IllegalArgumentException if the product of {@code w} + * and {@code h} is greater than {@code Integer.MAX_VALUE} + * @throws RasterFormatException if computing either * {@code location.x + w} or - * {@code location.y + h} results in integer - * overflow + * {@code location.y + h} results in integer overflow public static WritableRaster createPackedRaster(int dataType, int w, int h, int[] bandMasks, Point location) - * @throws RasterFormatException if {@code w} or {@code h} - * is less than or equal to zero, or computing either - * {@code location.x + w} or - * {@code location.y + h} results in integer - * overflow + * @throws IllegalArgumentException if {@code w} and {@code h} + * are not both greater than 0 + * @throws IllegalArgumentException if the product of {@code w} + * and {@code h} is greater than {@code Integer.MAX_VALUE} + * @throws RasterFormatException if computing either + * {@code location.x + w} or + * {@code location.y + h} results in integer overflow public static WritableRaster createPackedRaster(int dataType, int w, int h, int bands, int bitsPerBand, Point location) - * @throws RasterFormatException if {@code w} or {@code h} - * is less than or equal to zero, or computing either + * @throws IllegalArgumentException if {@code w} and {@code h} + * are not both greater than 0 + * @throws IllegalArgumentException if the product of {@code w} + * and {@code h} is greater than {@code Integer.MAX_VALUE} + * @throws IllegalArgumentException if computing either * {@code location.x + w} or - * {@code location.y + h} results in integer - * overflow + * {@code location.y + h} results in integer overflow public static WritableRaster createPackedRaster(DataBuffer dataBuffer, int w, int h, int scanlineStride, int[] bandMasks, Point location) - * @throws RasterFormatException if {@code w} or {@code h} - * is less than or equal to zero, or computing either + * @throws IllegalArgumentException if {@code w} and {@code h} + * are not both greater than 0 + * @throws IllegalArgumentException if the product of {@code w} + * and {@code h} is greater than {@code Integer.MAX_VALUE} + * @throws IllegalArgumentException if computing either + * {@code location.x + w} or + * {@code location.y + h} results in integer overflow + * @throws RasterFormatException if computing either * {@code location.x + w} or - * {@code location.y + h} results in integer - * overflow + * {@code location.y + h} results in integer overflow public static WritableRaster createPackedRaster(DataBuffer dataBuffer, int w, int h, int bitsPerPixel, Point location)
- csr of
-
JDK-8369129 Raster createPackedRaster methods specification clean up
-
- New
-