Question About MethodHandles.findSpecial
thobes at gmail.com
Tue May 5 09:02:23 PDT 2009
On Tue, May 5, 2009 at 5:15 PM, Fredrik Öhrström <
fredrik.ohrstrom at oracle.com> wrote:
> What is the purpose of being able to invoke the constructor
> through a MethodHandle? The reason I am asking is because
> to me, it seems like we cannot perform a new through
> a MethodHandle. Which means that we have to generate a
> factory method (to which we can bind a MethodHandle) to
> create a new instance and then we can just as well put
> the call to the constructor there. Or am i missing
> something? :-)
Isn't findSpecial just using the same semantics as invokespecial? i.e.
invoking/finding the method on the exact class instead of doing a virtual
dispatch. That is used for other things than only constructors, in Java this
is used for super.method(..)-invocations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mlvm-dev