RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class
Jorn Vernee
jvernee at openjdk.org
Wed Apr 17 11:02:00 UTC 2024
On Wed, 17 Apr 2024 08:46:59 GMT, Adam Sotona <asotona at openjdk.org> wrote:
> Current implementation of `LambdaMetafactory` does not allow to use lambdas in hidden classes. Invocation throws `NoClassDefFoundError` instead.
>
> This patch includes lambda implementation in a hidden class under the special handling of `useImplMethodHandle`.
> The patch also fixes `j/l/i/defineHiddenClass/BasicTest::testLambda` to correctly cover this test case.
>
> Please review.
>
> Thanks,
> Adam
Do we also need to check if the parameters or return type are hidden classes? I suppose if we compile a direct bytecode reference to the target method, all of them need to be referenceable from bytecode, not just the holder.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18810#pullrequestreview-2005733945
More information about the core-libs-dev
mailing list