On Tue, 1 Dec 2026 04:03:30 GMT, Daisuke Yamazaki <[email protected]> wrote:

> Please review this fix for `Set.ofLazy` and `Map.ofLazy` behaviour.
> 
> When looking up an object that is equal to a stored candidate but is a 
> different instance,
> `Set.contains()` and `Map.get()` pass the lookup argument to the computing 
> function instead of the stored candidate.
> 
> This change stores the candidates in an array and uses the lookup index to 
> retrieve the corresponding candidate before calling the computing function.
> 
> Regression tests have been added for both `Set` and `Map` to verify that the 
> computing function receives the stored candidate.
> 
> Tests:
> - `LazySetTest`
> - `tier1`
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Thanks @PeyaPeyaPeyang for working on this issue. I will soon submit another PR 
that does not require a separate array. Please keep your eyes open for that one 
and let me know what you think.

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

PR Comment: https://git.openjdk.org/jdk/pull/34144#issuecomment-7310949313

Reply via email to