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

John Hendrikx jhendrikx at openjdk.org
Wed Nov 5 16:19:39 UTC 2025


On Tue, 4 Nov 2025 21:56:19 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> John Hendrikx has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fix test
>>  - Rename setAll to replaceRange and removed superfluous method
>
> 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.

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

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


More information about the openjfx-dev mailing list