On Mon, 10 Jun 2024 04:08:41 GMT, Chen Liang <li...@openjdk.org> wrote:
>> Please review this patch that fixes a critical issue that breaks some Proxy >> usages. >> >> CONSTANT_Class and CONSTANT_MethodType must fail resolution for inaccessible >> package-private types per JVMS 5.4.3.1 and 5.4.3.5, yet such types can >> appear in method descriptors in the same class. The proposed way to bypass >> is to store the MethodType as its descriptor string in the bootstrap method >> arguments, and use MethodType.fromMethodDescriptorString to restore the >> arguments, which does not have this restriction and does not eagerly load >> the parameter classes. This case isn't covered by existing tests, so a new >> test has been added. > > Chen Liang has updated the pull request incrementally with one additional > commit since the last revision: > > Obtain classloader in security manager friendly code path Agree with Roger that static imports should be used sparingly (possibly never with .*). If other reviewers are happy with the semantic shift in when/where class loading can/will happen and which class loader will be used then I won't object. I'm just not enough of an expert in this area to tell if there might be unintended side-effects we need to account for. The added cost of spinning and calling these clinits means we might be better off reverting from a startup overhead perspective. JDK-8332457 was already a regression for some usage patterns. ------------- PR Comment: https://git.openjdk.org/jdk/pull/19615#issuecomment-2163123616