On Mon, 20 Apr 2026 16:24:45 GMT, Phil Race <[email protected]> wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8381007
>
> src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
>  line 164:
> 
>> 162:         this.dataType = dataType;
>> 163:         if ((numberOfBits <= 0) || ((numberOfBits & (numberOfBits - 1)) 
>> != 0)) {
>> 164:             throw new RasterFormatException("numberOfBits per pixel 
>> must be a power of 2");
> 
> You would have got an exception anyway for these (although 0 would have been 
> the wrong type).
> This just makes it clearer that you've passed in an illegal value because it 
> is not a power of 2, vs spanning a data element.

Why the validation splits in "parts"? It seems "this.dataType = dataType;" 
should be assigned only if all validation above and below are passed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30826#discussion_r3244610273

Reply via email to