RFR: 8273349: Check uses of Stream::peek in controls and replace as needed [v3]

Andy Goryachev angorya at openjdk.org
Thu Mar 28 17:55:39 UTC 2024


On Thu, 28 Mar 2024 08:49:44 GMT, drmarmac <duke at openjdk.org> wrote:

>> This PR removes potentially incorrect usages of Stream.peek().
>> The changed code should be covered by the tests that are already present.
>
> drmarmac has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Preallocate in SelectedIndicesList.set()
>  - Remove unused import

modules/javafx.controls/src/main/java/javafx/scene/control/ControlUtils.java line 166:

> 164:             sm.startAtomic();
> 165: 
> 166:             final List<Integer> removed = new ArrayList<>(c.getRemovedSize());

I wonder if we should add a check for 0 size here to bypass all this code if nothing is removed (same for added)

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1430#discussion_r1543395945


More information about the openjfx-dev mailing list