On Thu, 7 May 2026 09:08:32 GMT, Chen Liang <[email protected]> wrote:

>> 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
>
> src/java.base/share/classes/java/lang/Class.java line 643:
> 
>> 641:     @PreviewFeature(feature = PreviewFeature.Feature.VALUE_OBJECTS, 
>> reflective=true)
>> 642:     public boolean isValue() {
>> 643:         return !identity && !primitive && !isInterface();
> 
> We can update the VM representation to change `identity` injection to `value` 
> injection as a separate RFE probably for post lworld.

Yeah, it's possible, but I wasn't totally sure what other components might be 
inspecting this field directly. Didn't want to rock the boat. I agree it's 
worth considering as a future refactoring.

> src/java.base/share/classes/jdk/internal/value/ValueClass.java line 55:
> 
>> 53:     /// This excludes abstract value classes.
>> 54:     public static boolean isConcreteValueClass(Class<?> clazz) {
>> 55:         return clazz.isValue() && 
>> !Modifier.isAbstract(clazz.getModifiers());
> 
> Now this can be `clazz.isValue() && Modifier.isFinal(clazz.getModifiers())`, 
> before primitives would report they are value but they are `abstract final` 
> and thus fails the old test.

We don't have non-final concrete value classes today, but if we ever did, I 
guess it's best if the implementation matches the method name.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2397#discussion_r3205172065
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2397#discussion_r3205169301

Reply via email to