[lworld] RFR: 8294860: [lworld] Add java.util.Objects.isValueObject

Mandy Chung mchung at openjdk.org
Tue Oct 11 22:57:31 UTC 2022


On Tue, 11 Oct 2022 18:51:47 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Add method `java.util.Objects.isValueObject(Object obj)`.
> 
> The complement to `Objects.isIdentityObject(Object obj)` this method return true if the object is a value object.
> 
> Add the cases to the existing ObjectMethods test.

Marked as reviewed by mchung (Committer).

src/java.base/share/classes/java/util/Objects.java line 267:

> 265: 
> 266:    /**
> 267:     * {@return {@code true} if the specified object reference is a value object,

Maybe add a link to `{@linkplain Class#isValue value} object`.

"object reference" might cause confusion and consider as pass by reference.    The `java.util.Objects` APIs are inconsistent and some uses "object reference" and some don't.

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

PR: https://git.openjdk.org/valhalla/pull/786



More information about the valhalla-dev mailing list