RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded [v2]

Kasper Nielsen duke at openjdk.org
Thu Feb 23 09:34:09 UTC 2023


On Wed, 22 Feb 2023 21:29:12 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> In all the places I've seen LambdaMetaFactory used, it is because of performance over reflection/non-static method handles. See, for example, https://www.optaplanner.org/blog/2018/01/09/JavaReflectionButMuchFaster.html. I believe Optaplanner is still using it.
>> 
>> There is also quite a number of posts on StackOverflow on people trying to use LambdaMetafactory:
>> https://stackoverflow.com/search?q=LambdaMetafactory
>
> @kaspernielsen, i believe that now that hidden class + class data are part of the public API,
> you do not need to use lambda metafactory directly. But it requires Java 17 not 8 or 11.

@forax I think what attracted people was that you didn't have to add any dependencies (ASM). It is also simpler than having to deal with class files. Maybe once we get the Classfile API people will reconsider. Still, LambdaMetaFactory is just a couple of lines of code. So will probably be hard to resist for some people.

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

PR: https://git.openjdk.org/jdk/pull/12493


More information about the core-libs-dev mailing list