On Fri, 5 May 2023 13:08:33 GMT, Chen Liang <li...@openjdk.org> wrote:
>> Also, perhaps @PaulSandoz knows more history on this one (I believe this >> code predates FFM). > > Eh? I am not sure what you mean here. This is the essence of the patch, where > the "TODO" above is fixed: lookup.findStaticVarHandle now creates lazy > varhandle if the defining class of the field is not initialized. > > The fixing of IndirectVarHandle.isAccessModeSupported is a side effect, > because the override of `getMethodHandle` in `IndirectVarHandle` appears to > me as a no-op; turns out it exists due to NPE in isAccessModeSupported, which > IMO should be fixed as it's a public API. > This seems unrelated to the issue this PR is really about (if I understand > correctly). Would it make sense to address this as part of another PR? Actually I realize I was confused as I came to this PR looking at this: https://bugs.openjdk.org/browse/JDK-8307508 And not realizing that this PR is about initialization (and, as a side-fix, it also addresses the access mode issue). I will leave to you whether to split or not. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13821#discussion_r1186077002