On Mon, 25 May 2026 09:15:34 GMT, Viktor Klang <[email protected]> wrote:

>> ReflectionFactory.newConstructorForSerializatoin might bypass strict 
>> initialization. We should make sure the skipped classes in the constructor 
>> chain do not declare strict instance fields.
>> 
>> This updates the specification of jdk.unsupported's ReflectionFactory to 
>> reflect this behavioral update.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> src/java.base/share/classes/jdk/internal/value/ValueClass.java line 156:
> 
>> 154:                 // Not class or interface
>> 155:                 return false;
>> 156:             }
> 
> Might be better to put this check in `public static boolean 
> hasStrictInstanceField(Class<?> cl)` so the cheap check doesn't need to 
> populate the ClassValue at all.

(We can keep the check in `computeValue` as well)

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2350#discussion_r3297203107

Reply via email to