RFR: 8159746: (proxy) Support for default methods [v7]
Alan Bateman
alanb at openjdk.java.net
Mon Nov 30 19:24:58 UTC 2020
On Mon, 30 Nov 2020 19:14:08 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/reflect/Proxy.java line 1281:
>>
>>> 1279: * @return a lookup for proxy class of this proxy instance
>>> 1280: */
>>> 1281: private static MethodHandles.Lookup proxyClassLookup(MethodHandles.Lookup caller, Class<?> proxyClass) {
>>
>> The method description could be a bit clearer. It invokes the proxy's proxyClassLookup method to get a Lookup on the proxy class ("this proxy instance" is just a bit confusing as proxyClassLookup is static).
>> I guess the caller parameter isn't really needed as it could be crated in proxyClassLookup.
>
> The caller parameter is just another level of defense. I updated as:
>
> /**
> - * Returns a Lookup object for the lookup class which is the class of this
> - * proxy instance.
> + * This method invokes the proxy's proxyClassLookup method to get a
> + * Lookup on the proxy class.
> *
> * @return a lookup for proxy class of this proxy instance
> */
Much better, thanks!
-------------
PR: https://git.openjdk.java.net/jdk/pull/313
More information about the core-libs-dev
mailing list