Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Remi Forax
Thinking a little bit more about that, you can almost use a lambda proxy as a reflect proxy, yes, almost because the lambda metafactory doesn't understand varargs. class Main { public static void print(Object... args) { System.out.println(Arrays.toString(args)); } public static void m

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Jochen Theodorou
Am 09.10.2014 19:07, schrieb Remi Forax: public static void main(String[] args) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Lookup lookup = MethodHandles.publicLookup().in(Consumer.class); Field allowedModes = Lookup.class.getDeclaredField("allowedMod

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Jochen Theodorou
Am 09.10.2014 17:32, schrieb Alessio Stalla: [...] Well, you can extend this technique by using more method references and delegation (yes, even more levels of indirection!), in short: I should just produce my own proxy system ;) Or in other words, there is no proper replacement in the JDK for

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Remi Forax
public static void main(String[] args) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Lookup lookup = MethodHandles.publicLookup().in(Consumer.class); Field allowedModes = Lookup.class.getDeclaredField("allowedModes"); allowedModes.setAccessible(true);

Re: [9] Review request : JDK-8058733: [TESTBUG] java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java and LFMultiThreadCachingTest.java failed on some platforms due to java.lang.VirtualMachineErro

2014-10-09 Thread Joe Darcy
Looks fine Konstantin. (These tests have been failing very often since they were pushed. If your fix isn't pushed today, I'd argue for the tests being excluded.) Thanks, -Joe On 10/9/2014 1:44 AM, Konstantin Shefov wrote: Hi, I have updated the webrev to take into account the JDK 9 new fea

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Alessio Stalla
On Thu, Oct 9, 2014 at 5:22 PM, Jochen Theodorou wrote: > Am 09.10.2014 17:02, schrieb Alessio Stalla: > >> "All problems in computer science can be solved by another level of >> indirection"... "except for the problem of too many layers of >> indirection". >> >> What about (untested): >> >> Cons

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Jochen Theodorou
Am 09.10.2014 17:02, schrieb Alessio Stalla: "All problems in computer science can be solved by another level of indirection"... "except for the problem of too many layers of indirection". What about (untested): Consumer proxy = Proxy.newProxyInstance(...); Consumer myConsumer = proxy::accept;

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Jochen Theodorou
Am 09.10.2014 16:51, schrieb Vladimir Ivanov: Jochen, too bad no-one knows. Has anyone an idea for a better place to ask this? (btw, because of the getSimpleName issue I can't use MethodHandleProxies) FYI, I plan to get MethodType.toString() problem fixed in 8u40. I wish you would know how o

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Alessio Stalla
"All problems in computer science can be solved by another level of indirection"... "except for the problem of too many layers of indirection". What about (untested): Consumer proxy = Proxy.newProxyInstance(...); Consumer myConsumer = proxy::accept; If you keep the proxy inaccessible, nobody wil

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Vladimir Ivanov
Jochen, too bad no-one knows. Has anyone an idea for a better place to ask this? (btw, because of the getSimpleName issue I can't use MethodHandleProxies) FYI, I plan to get MethodType.toString() problem fixed in 8u40. Best regards, Vladimir Ivanov Am 06.10.2014 18:06, schrieb Jochen Theodo

Re: invoking a interface default method from within an InvocationHandler

2014-10-09 Thread Jochen Theodorou
too bad no-one knows. Has anyone an idea for a better place to ask this? (btw, because of the getSimpleName issue I can't use MethodHandleProxies) Am 06.10.2014 18:06, schrieb Jochen Theodorou: Hi, I find this a little odd and I wonder how you are supposed to do it right. Or if that is a bug

Re: [9] Review request : JDK-8058733: [TESTBUG] java/lang/invoke/LFCaching/LFSingleThreadCachingTest.java and LFMultiThreadCachingTest.java failed on some platforms due to java.lang.VirtualMachineErro

2014-10-09 Thread Konstantin Shefov
Hi, I have updated the webrev to take into account the JDK 9 new feature with segmented code cache. http://cr.openjdk.java.net/~kshefov/8058733/webrev.02 Please, review. -Konstantin On 08.10.2014 21:25, Joe Darcy wrote: Hello, I approve this change going into jdk9/dev contingent on the fai