Am 12.01.2018 um 22:49 schrieb Michał Zegan:
well you rather know what getChildren returns, so you know what the
returned object is, like generally.

but as soon as the method you want to call is not on the statically declared type, nor within a set of known statically types you are having a problem. There is no good way (good in terms of usability and performance) to get an arbitrary valid method object without static information. You are always forced to traverse the hierarchy to find the most accessible type. You will have to check access... and then of course there the two bad scenarios where invocation and search are not the same class or actual caller and caller are not equal. Which leads to a lengthy search using reflection to find a method, transfer it to a method handle and then let the invoker do the actual call.

bye Jochen

Reply via email to