RFR: 8091429: ObservableList<E>#replaceRange(int from, int to, Collection<? extends E> col) [v2]

Kevin Rushforth kcr at openjdk.org
Wed Nov 5 17:37:18 UTC 2025


On Wed, 5 Nov 2025 16:16:43 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> modules/javafx.base/src/test/java/test/javafx/collections/ModifiableObservableListBaseTest.java line 94:
>> 
>>> 92:         @Test
>>> 93:         void shouldReplaceElementsAtGivenRange() {
>>> 94:             assertTrue(list.replaceRange(1, 3, List.of("B", "C", "D")));
>> 
>> Would additional tests be useful?
>> 
>> * Replace a sub-range in the middle (so both beginning and end are kept)
>> * Replace a sub-range with fewer elements than are removed (the existing test checks the case of more elements added than removed)
>
> Always hard to say where to end, I had full coverage I think, but I added the suggested extra tests anyway as coverage isn't everything.

Yes, it is a judgment call in many cases. The new tests look good.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1937#discussion_r2495513464


More information about the openjfx-dev mailing list