Re: Can't call certain accessible methods using reflection

2016-11-28 Thread Michael Rasmussen
It might be worth noting that invoking it using MethodHandles works: MethodHandle mh = MethodHandles.lookup().findVirtual(Public.class, "m", MethodType.methodType(void.class)); mh.invoke(p); /Michael On 28 November 2016 at 15:17, Jochen Theodorou wrote: > > > On 28.11.2016

Re: Can't call certain accessible methods using reflection

2016-11-28 Thread Jochen Theodorou
On 28.11.2016 12:23, Peter Levart wrote: [...] // Module m1: module m1 { exports pkg1; } package internal; public class InternalImpl { public void m() { System.out.println("m()"); } } package pkg1; public class Public extends internal.InternalImpl { } is it legal for

Can't call certain accessible methods using reflection

2016-11-28 Thread Peter Levart
Hi, I encountered a situation in which calling a method using reflection is not possible, while the same method can be called with bytecode instruction. Here's an example: // Module m1: module m1 { exports pkg1; } package internal; public class InternalImpl { public void m() {