On Fri, 2 Jun 2023 01:19:26 GMT, Chen Liang <li...@openjdk.org> wrote:
> In addition, should we initialize the ref class or the declaring class only? > I don't think we need to initialize the ref class when declaring class > initialization should be sufficient, but that is a change in behavior. Declaring class will be initialized [1]. refc should be equals to the declaring class because the static field to be looked up can only be found in the declaring class. There should be no behavioral change. [1] https://download.java.net/java/early_access/jdk21/docs/api/java.base/java/lang/invoke/MethodHandles.Lookup.html#findStaticVarHandle(java.lang.Class,java.lang.String,java.lang.Class) ------------- PR Comment: https://git.openjdk.org/jdk/pull/13821#issuecomment-1573031355