Re: RFE: LambdaMetafactory to a class on another ClassLoader - an API gap?

2018-02-16 Thread Geoffrey De Smet
You're right. I can confirm this works like a charm on JDK 9:     MethodHandles.Lookup lookup = MethodHandles.privateLookupIn(loadedClass, MethodHandles.lookup());     CallSite site = LambdaMetafactory.metafactory(lookup,    

Re: RFE: LambdaMetafactory to a class on another ClassLoader - an API gap?

2018-02-12 Thread Claes Redestad
Hi Geoffrey, since 9 there's MethodHandles.privateLookup(Class, Lookup)[1] to get hold of a Lookup with the full, private capabilities of a specific class, as required by LambdaMetafactory. Replacing line 62 in your sample with the following should work:     MethodHandles.Lookup lookup

RFE: LambdaMetafactory to a class on another ClassLoader - an API gap?

2018-02-12 Thread Geoffrey De Smet
Hi all, As a developer for a Java framework, I 'd like to use the MethodHandle API or the LambdaMetafactory as an alternative to code generation or reflection to call getter/setters on my user's classes, often loaded by another classloader. Because non-static MethodHandles are currently too slow