On Mon, 22 Jun 2026 13:30:34 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8386671
>
> There is an inconsistency here:
> 
> https://github.com/prrace/jdk/blob/abb512a0e1c65743358c4c2319b40cb15bb85487/src/java.desktop/share/classes/java/awt/image/Raster.java#L275-L307
> 
> 
>  * @throws IllegalArgumentException if {@code scanlineStride}
>  *         is less than or equal to 0
>  * @throws IllegalArgumentException if {@code pixelStride} is less than or 
> equal to 0
>  
>  ...
>  
>   public static WritableRaster createInterleavedRaster(int dataType,
>                                                      int w, int h,
>                                                      int scanlineStride,
>                                                      int pixelStride,
>                                                      int[] bandOffsets,
>                                                      Point location) {
>                                                   
>  ...
>  
> if (pixelStride <= 0) {
>     throw new IllegalArgumentException("pixelStride is <= 0");
> }
> if (scanlineStride <= 0) {
>     throw new IllegalArgumentException("scanlineStride is <= 0");
> }
> 
> 
> https://github.com/prrace/jdk/blob/abb512a0e1c65743358c4c2319b40cb15bb85487/src/java.desktop/share/classes/java/awt/image/Raster.java#L795-L818
> 
> 
>  * @throws IllegalArgumentException if {@code scanlineStride}
>  *         is less than 0
>  * @throws IllegalArgumentException if {@code pixelStride} is less than 0
> 
> ...
> 
> public static WritableRaster createInterleavedRaster(DataBuffer dataBuffer,
>                                                      int w, int h,
>                                                      int scanlineStride,
>                                                      int pixelStride,
>                                                      int[] bandOffsets,
>                                                      Point location)
> ...
> 
>     if (pixelStride <= 0) {
>         throw new IllegalArgumentException("pixelStride is <= 0");
>     }
>     if (scanlineStride <= 0) {
>         throw new IllegalArgumentException("scanlineStride is <= 0");
>     }
> 
> 
> 
> Note that the `<= 0` check contradicts the doc stating `less than 0`.
> 
> 
> 
> https://github.com/prrace/jdk/blob/abb512a0e1c65743358c4c2319b40cb15bb85487/src/java.desktop/share/classes/java/awt/image/Raster.java#L446-L472
> 
> 
>  * @throws IllegalArgumentException if {@code scanlineStride}
>  *         is less than 0
> 
> public static WritableRaster createBandedRaster(int dataType,
>                                                 int w, int h,
>                                                 int scanlineStride,
>    ...

@azvegint @kizune please review

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31540#issuecomment-4784675638

Reply via email to