RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Sep 28 09:43:21 UTC 2022


On Wed, 28 Sep 2022 09:38:06 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> For negative values, the spec says "@throws IndexOutOfBoundsException if either index is less than {@code -1}" which it does.
>
> Well, the spec says nothing about it for this method: https://github.com/openjdk/jdk/blob/096bca4a9c5e8ac2668dd965df92153ea1d80add/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java#L684-L690
> 
> I guess it should be update to state it explicitly.

To remove an index, I guess we need to first do setSelection where we will already throw IOOBE so I guess that's why this method does not mention or handle it explicitly

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

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



More information about the client-libs-dev mailing list