<AWT Dev> RFR: 8270058: Use Objects.check{Index, FromToIndex, FromIndexSize} for java.desktop [v2]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Fri Jul 30 06:26:31 UTC 2021


On Tue, 27 Jul 2021 02:46:53 GMT, Yi Yang <yyang at openjdk.org> wrote:

>> I meant 
>> 
>> if (imageIndex < minIndex)
>>                     throw new IndexOutOfBoundsException();
>> 
>> can't it be replaced with Objects.checkFromToIndex(minIndex, imageIndex, ..
>
> Hi, sorry for the late response. checkFromToIndex has many constraints, this code may not satisfy those constraints, so I don't think we should do that in this PR.(Maybe we can file a new PR to do replacement carefully)

OK...The subject line of this PR states that checkFromToIndex will also be used but I see only checkIndex so I intervened. Anyways, the code in question is in test so not much of an issue.

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

PR: https://git.openjdk.java.net/jdk/pull/4718


More information about the awt-dev mailing list