[lworld] RFR: 8346307: [lworld] Clarify identity vs value in Class, Objects, and document limitations of value objects [v9]
Chen Liang
liach at openjdk.org
Wed Jun 25 22:37:44 UTC 2025
On Wed, 25 Jun 2025 22:05:56 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Add APINote and javadoc for IdentityException where it will be useful to know that identity or value objects are treated differently.
>> Simplified WeakHashMap javadoc updates for IdentityException.
>> Added note to System.identityHashCode to include value objects.
>> Added to class javadoc for IdentityHashMap for value objects.
>
> Roger Riggs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
>
> - A few editorial changes
> Highlight that in preview-mode, Objects can have either identity or value subclasses.
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - "value interface" is a left over from an earlier design and is not allowed by the JEP 401 JLS.
> An interface will never have the ACC_IDENTITY modifier, hence 'isValue()' will be true but is not significant.
> Class.toGenericString() should only include the "value" prefix for record and regular classes.
> Correct the test to match the toGenericString() output.
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - Merge
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - Merge branch 'lworld' into 8346307-throws-identityexception
> - ... and 6 more: https://git.openjdk.org/valhalla/compare/81fbc414...6cbade17
We should document explicitly that all classes, including primitives and void, are considered identity when preview features are not enabled.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1327#issuecomment-3006435915
More information about the valhalla-dev
mailing list