RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent
Sergey Bylokhov
serb at openjdk.org
Tue May 20 02:02:51 UTC 2025
On Mon, 19 May 2025 12:35:13 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> ok, then it is fine as is.
>
> 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?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2096713898
More information about the client-libs-dev
mailing list