On Mon, 19 May 2025 12:35:13 GMT, Alexey Ivanov <aiva...@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

Reply via email to