On Tue, 5 May 2026 21:18:31 GMT, Phil Race <[email protected]> wrote:
>> src/java.desktop/share/classes/java/awt/image/PixelInterleavedSampleModel.java
>> line 82:
>>
>>> 80: * one of the supported data types
>>> 81: * @throws NullPointerException if {@code bandOffsets} is {@code
>>> null}
>>> 82: * @throws IllegalArgumentException if {@code bandOffsets.length}
>>> is 0
>>
>> It is mentioned
>>
>> if (numBands <= 0) {
>> throw new IllegalArgumentException("Number of bands must be >
>> 0");
>> }
>>
>> so maybe `@throws IllegalArgumentException if {@code bandOffsets.length} is
>> not greater than 0` is more apt
>> but I see ComponentSampleModel the superclass of this, also mentioned the
>> same although its superclass SampleModel mentioned
>> `@throws IllegalArgumentException if {@code numBands} is less than 1`
>
> I suspect we have many variations on this across the API. I'm not going to go
> make them all consistent, at least not today, but I'm happy enough with the
> current phrasing because I'm preferring throws clauses which say when an
> exception will be thrown rather than when it will not be thrown.
It is only mentioned for value 0 but Exception is also thrown for {@code
bandOffsets.length} < 0 too which is missing here so I pointed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30902#discussion_r3192968488