On Fri, 31 Jul 2026 21:03:09 GMT, Joe Darcy <[email protected]> wrote:

> Another update to Object.equals to better support value classes.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/java/lang/Object.java line 182:

> 180:      * constraint as multiple indistinguishable value objects could be
> 181:      * constructed, depending on the semantics of the particular value
> 182:      * class.

I would use the term "a single distinguishable element" instead of going into 
"multiple value objects" - "multiple" is an impression from the times when each 
constructor invocation creates a new distinguishable instance. Value objects 
are not necessarily constructed, either - in hotspot, you may load from a field 
twice and get two indistinguisable value objects, but another implementation 
may deduplicate them, and all these deduplication etc. are not visible to 
programs based on our specs.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32158#discussion_r3695660834

Reply via email to