RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent

Andrey Turbanov aturbanov at openjdk.org
Mon May 19 08:26:28 UTC 2025


On Wed, 30 Apr 2025 03:33:36 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Simplified how?
>
> the loop over invalidComponents

Do you suggest to use `List.indexOf` instead of manual loop?
https://github.com/openjdk/jdk/blob/375ac6d446332f0763ce294b200143ff63865cf6/src/java.desktop/share/classes/javax/swing/RepaintManager.java#L366-L371

This loop uses `==` comparison, while `List.indexOf` uses `equals()`. It could change semantic

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2068043227


More information about the client-libs-dev mailing list