RFR: 8078641: MethodHandle.asTypeCache can retain classes from unloading [v3]

Mandy Chung mchung at openjdk.java.net
Thu Sep 9 16:19:07 UTC 2021


On Fri, 3 Sep 2021 12:01:12 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> > For the change of MethodHandle::asType to a final method, this needs a CSR.
> 
> It is not allowed to extend/subclass `MethodHandle` outside `java.lang.invoke` package.
> So, the aforementioned change doesn't have any compatibility risks. Do I miss something important?
> 
> ```
>     /**
>      * Package-private constructor for the method handle implementation hierarchy.
>      * Method handle inheritance will be contained completely within
>      * the {@code java.lang.invoke} package.
>      */
>     // @param type type (permanently assigned) of the new method handle
>     /*non-public*/
>     MethodHandle(MethodType type, LambdaForm form) {
> ```

Sorry for the late reply as I was on vacation and just return today.

Thanks for the clarification.  I missed the fact that `MethodHandle` has no public constructor and cannot be extended.  This is fine.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5246


More information about the core-libs-dev mailing list