RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent
Andrey Turbanov
aturbanov at openjdk.org
Mon Jul 7 12:23:41 UTC 2025
On Tue, 20 May 2025 02:00:21 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Yet there could be a logical error anyway… `addInvalidComponent` uses identity comparison when adding a component but `removeInvalidComponent` relies on `equals` method to remove a component.
>>
>> If a component overrides `equals`, it could lead to unpredictable behaviour: a wrong component could be removed.
>
> Then it's better to use "==" in all cases, what do you think?
Filled [JDK-8361493](https://bugs.openjdk.org/browse/)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2189912212
More information about the client-libs-dev
mailing list