On Thu, 13 Jun 2024 13:59:09 GMT, Chen Liang <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 676:
>>
>>> 674: * @param method The method for which to create a
>>> proxy
>>> 675: */
>>> 676: private ProxyMethod(Method method, String methodFieldName) {
>>
>> Could we pass the `FieldRefEntry` directly? I don't see when we'd create a
>> `ProxyMethod` without later calling `methodField()`. I think this would also
>> remove the need to make `ProxyMethod` non-static.
>
> Good suggestion. However, ProxyMethod will stay non-static, for the field ref
> is still bound to class Constant Pool and bytecode generation reuses many
> non-static CP items from ProxyGenerator. Will update the patch in gist as I
> push too.
The `methodField` reference is now created within the ProxyMethod constructor.
The gist linked in the PR description has also been updated.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19615#discussion_r1638287881