On Fri, 7 Oct 2022 19:50:19 GMT, Alexey Ivanov <[email protected]> wrote:

>> I guess Integer.MAX_VALUE should be valid "int" value, its because of 
>> internal calculation which is causing it to overflow so I guess we should 
>> not update the spec for wrongful calculation. 
>> I have fixed the overflow in setSelectionInterval.
>
> This is not a generic class, its main purpose is to handle list selection in 
> UI components, such as `JList`. Excluding `Integer.MAX_VALUE` makes sense to 
> me, it simplifies the code: no additional check in the loop and no special 
> handling `removeIndexInterval` which also adds a condition to the loop.

OK. Practically, it seems right as list probably may not have MAX_VALUE 
entries..Updated to exclude MAX_VALUE and updated the javadoc.

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

PR: https://git.openjdk.org/jdk/pull/10409

Reply via email to