On Thu, 7 May 2026 22:51:22 GMT, Dan Smith <[email protected]> wrote:

>> Two changes:
>> 
>> - Remove the `Class.isIdentity` method, which is redundant given the 
>> `Class.isValue` method
>> - Clean up `Class.isValue` so that it only returns true for value classes, 
>> not other non-identity things (interfaces, primitives)
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Dan Smith has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   compare-and-set checks don't need to look at field type

Interested in feedback: is this the right behavior for the method?

My thinking is:

- The reflection API is mainly focused on language-oriented terminology, even 
as it is rooted in class files. "Constructor", not "instance initializer". 
Awareness of anonymous and inner classes. Hence `isValue` rather than 
`isIdentity`.
- The reflection API tends to offer a simple _syntactic_ presentation rather 
than more complex _semantic_ properties. No subtyping or generic substitution. 
No inheritance or overriding relationships. Hence "is this a class with a value 
modifier" rather than "is this an entity that doesn't need identity?" or "is 
this a type that could have identityless values?".

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

PR Comment: https://git.openjdk.org/valhalla/pull/2397#issuecomment-4401781626

Reply via email to