On Fri, 2 Jun 2023 17:16:09 GMT, Mandy Chung <mch...@openjdk.org> wrote:

> > I think we only need to initialize Parent without initializing Child in 
> > this case.
> 
> The bytecode behavior to access the field via 
> `lookup.findStaticVarHandle(Child.class, "value", int[].class)` is 
> `Child.value;`. The class or interface that declared the resolved field is 
> initialized per JVMS `getStatic` and `putStatic`. So I think `Parent` is 
> initialized but not `Child`. @PaulSandoz can confirm.

Yes, confirmed (verified both with explicit field access, `Child.value`,  and 
access using a direct method handle).

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

PR Comment: https://git.openjdk.org/jdk/pull/13821#issuecomment-1574162809

Reply via email to