On Tue, 1 Dec 2026 00:58:53 GMT, Dan Smith <[email protected]> wrote:

> The primary enhancement here is a more fleshed-out discussion about value 
> objects, and particularly their interaction with `==`, in the 
> `java.lang.Object` javadoc.
> 
> Then I've done some cleanup of links, directing discussion about "value 
> objects" to `Object##value-objects`, "indistinguishable" to 
> `Object##comparing-objects`. In some situations, it's more appropriate to 
> link "has identity" to `Objects##hasIdentity` and "value class" to 
> `Class#isValue`, but I've reduced reliance on those.
> 
> Browsable docs build here: 
> https://cr.openjdk.org/~dlsmith/8389875/8389875-20261130/api/index.html
> 
> (Timeline note: this is a doc-only fix, I'm not worried about getting it 
> integrated before the Dec 3 rampdown deadline.)
> 
> ---------
> - [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 58:

> 56:  *          For identity objects, this is a test that the two references 
> refer
> 57:  *          to an object that was created by a single creation event, 
> like the
> 58:  *          evaluation of a class instance creation expression. For value

For most Java developers, I think this section would be more informative if 
"you know, `new Foo()` " get explicitly discussed somewhere as it is more 
familiar than a more formal phrase like "class instance creation expression".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/34140#discussion_r4748576640

Reply via email to