On Sat, 1 Aug 2026 13:05:02 GMT, Chen Liang <[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.

Thanks @liach.

@dansmithcode, please advise on wording here.

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

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

Reply via email to