On Wed, 20 May 2026 17:03:39 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8378464
>
> src/java.desktop/share/classes/java/awt/image/BandedSampleModel.java line 176:
> 
>> 174:      * @throws ArrayIndexOutOfBoundsException if any of the bank 
>> indices is out of bounds
>> 175:      */
>> 176:     public SampleModel createSubsetSampleModel(int[] bands) {
> 
> Do we need to update the spec for the parent SampleModel class?

In the "description" of this PR I wrote
"The super-class SampleModel. createSubsetSampleModel is NOT updated because in 
fact one subclass behaves differently because it supports only one band."

> src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java line 
> 402:
> 
>> 400:      * @throws RasterFormatException if the number of bands is greater 
>> than
>> 401:      *                               the number of banks in this sample 
>> model.
>> 402:      * @throws ArrayIndexOutOfBoundsException if any of the bank 
>> indices is out of bounds
> 
> bank --> band

ok

> src/java.desktop/share/classes/java/awt/image/PixelInterleavedSampleModel.java
>  line 162:
> 
>> 160:      * @throws RasterFormatException if the number of bands is greater 
>> than
>> 161:      *                               the number of bands in this sample 
>> model.
>> 162:      * @throws ArrayIndexOutOfBoundsException if any of the bank 
>> indices is out of bounds
> 
>>if any of the bank indices is out of bounds
> 
> should be
> 
>>if any of the band indices is out of bounds
> 
> ?

ok

> src/java.desktop/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
>  line 310:
> 
>> 308:      * an image with a subset of the bands of the original
>> 309:      * SinglePixelPackedSampleModel/DataBuffer combination.
>> 310: 
> 
> empty line, missing "*"?

added the "*"

> test/jdk/java/awt/image/PixelInterleavedSMConstructor.java line 37:
> 
>> 35:     static final int[] nullbands = null;
>> 36:     static final int[] zerobands = { };
>> 37:     static final int[] oneband = { 0 };
> 
> might be useful to check band with negative data?

I added such a case.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30902#discussion_r3277534803
PR Review Comment: https://git.openjdk.org/jdk/pull/30902#discussion_r3277542498
PR Review Comment: https://git.openjdk.org/jdk/pull/30902#discussion_r3277544723
PR Review Comment: https://git.openjdk.org/jdk/pull/30902#discussion_r3277549334
PR Review Comment: https://git.openjdk.org/jdk/pull/30902#discussion_r3277555827

Reply via email to