[lworld] RFR: 8361496: [lworld] Treating interfaces as isValue() leads to failed assert [v2]

Chen Liang liach at openjdk.org
Tue Jul 15 13:41:54 UTC 2025


On Mon, 14 Jul 2025 17:42:09 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Test both preview and non-preview for ValueClassTest
>
> src/java.base/share/classes/jdk/internal/value/ValueClass.java line 45:
> 
>> 43:     /// This excludes primitives and includes Object.
>> 44:     public static boolean isValueObjectCompatible(Class<?> fieldType) {
>> 45:         return PreviewFeatures.isEnabled() && !fieldType.isPrimitive() && (!fieldType.isIdentity() || fieldType == Object.class);
> 
> The `fieldType == Object.class` would always be true regardless of enable-preview.
> That does not seem to be accurate and might be mis-interpreted by a caller.

?? I enclosed that check in a pair of parentheses so its `||` is checked before any of the `&&`, don't think this returns `true` for `Object.class` without preview enabled.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1504#discussion_r2207509678


More information about the valhalla-dev mailing list