On Tue, 21 Apr 2026 18:02:28 GMT, Chen Liang <[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/reflect/MethodHandleAccessorFactory.java
 line 141:

> 139:     }
> 140: 
> 141:     private static void checkConstructorInSuperclass(Class<?> decl, 
> Constructor<?> ctor) {

I'm not sure about the terminology we're using here, but I'm finding it hard to 
interpret this method name, suggest renaming somehow. We're not really checking 
the _constructor_ so much as checking all the classes on the path to the 
constructor.

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

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

Reply via email to