On Fri, 31 Jul 2026 04:11:43 GMT, Chen Liang <[email protected]> wrote:

>> Add reference to "indistinguishable" in Object.equals.
>> 
>> 
>> 
>> 
>> ---------
>> - [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/Double.java line 181:
> 
>> 179:  * is distinguished from every other bit pattern encoding a NaN.
>> 180:  * Note this is the notion of equivalence used when {@linkplain
>> 181:  * Object#equals(Object) comparing value objects for equality}.
> 
> The link to Object::equals is misleading: Only its implementation 
> specification briefly mentions "indistinguishable value objects". I think we 
> can just remove the link and keep the text.

My goal here is to link to some broader discussion of equality of value objects 
since "indistinguishable" has been introduced as a term to describe their 
semantics. Object.equals is one candidate for that. I've looked at the 
"Value-based Classes" page and that doesn't have a concentrated discussion of 
how value object comparison is done.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32114#discussion_r3691795461

Reply via email to